Tag for questions about Multi layer perceptrons (MLP). It is a class of feedforward artificial neural network. Multilayer perceptrons are sometimes colloquially referred to as "vanilla" neural networks, especially when they have a single hidden layer
Questions tagged [mlp]
275 questions
2
votes
1 answer
LIME feature explaining produces invalid key error
I have an MLPRegressor that works really well with my dataset. Here is a trimmed version of my code cutting out some unnecessary things:
from sklearn.neural_network import MLPRegressor
from sklearn.model_selection import train_test_split
from…

artemis
- 6,857
- 11
- 46
- 99
2
votes
1 answer
Extract an MLPRegressor attributes (n_iter_ ) for the best model in a pipeline with GridsearchCV?
I made a GridsearchCV with a pipeline and I want to extract one attribute (n_iter_) of a component of the pipeline (MLPRegressor) for the best model.
I'm using Python 3.0.
Creation of the pipeline
pipeline_steps = [('scaler', StandardScaler()),…

rmarion37
- 73
- 7
2
votes
3 answers
What kind of activation is used by ScikitLearn's MLPClasssifier in output layer?
I am currently working on a classification task with given class labels 0 and 1. For this I am using ScikitLearn's MLPClassifier providing an output of either 0 or 1 for each training example. However, I can not find any documentation, what the…

S.Maria
- 131
- 2
- 11
2
votes
1 answer
MLP Classifier: "ValueError: Unknown label type"
I am trying to create a basic NN using MLP Classifier.
When I use the method mlp.fit a get the following error:
ValueError: Unknown label type: (array([
Below my simple code
df_X_train = df_train[["Pe/Pe_nom","Gas_cons","PthLoad"]]
df_Y_train =…

Pier
- 97
- 1
- 13
2
votes
1 answer
TypeError: predict() takes 2 positional arguments but 3 were given
I looked for this error on stackoverflow and found several posts, but no one adressing this specific situation.
I have the following dataframe:
the inputvariables and outputvariables are defined in this…

Steven Pauly
- 185
- 1
- 2
- 13
1
vote
0 answers
How can I use BERT to generate a long paragraph?
I am trying to write an image-capturing model, use the CNN model to extract the image feature, and then connect with BERT and MLP to generate a long paragraph However, after training, my model result is really bad. In my MLP part, I should add LSTM…

MHW
- 21
- 2
1
vote
0 answers
How do I train the NN layers when the loss function is doing a derivative of the NN
To give you some context, I am training a neural network that learn a Hamiltonian. To do so, I must use a customized neural network like the following.
class HNN(keras.Model):
def __init__(self, input_dim=2, hidden_dim=200):
super(HNN,…
1
vote
1 answer
Pytorch Neural Networks Multilayer Perceptron Binary Classification i got always same accuracy
I'm trying to multilayer perceptrone binary classification my own datasets. but i always got same accuracy when i change epoch number and learning rate.
My Multilayer Perceptron class
class MyMLP(nn.Module):
def __init__(self,…

Yusuf Kalyoncu
- 13
- 2
1
vote
0 answers
Minority class precision, recall, fscore all become zero with MLP classifier
I trained my model with MLP classifier which is available on SkLearn.
I split the data using the code
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, stratify=y, random_state=1)
The X_train length = 9405
Class distribution…

Encipher
- 1,370
- 1
- 14
- 31
1
vote
1 answer
Precision, recall, F1 score all have zero value for the minority class in the classification report
I got error while using SVM and MLP classifiers from SkLearn package. The error is C:\Users\cse_s\anaconda3\lib\site-packages\sklearn\metrics_classification.py:1327: UndefinedMetricWarning: Precision and F-score are ill-defined and being set to 0.0…

Encipher
- 1,370
- 1
- 14
- 31
1
vote
1 answer
Pytorch mat1 and mat2 must have the same dtype mlp
So i am trying to do a function that trains an mlp using PyTorch.
My code is as follows :
def mlp_gradient_descent(x,y , model , eta = 1e-6 , nb_iter = 30000) :
loss_descent = []
dtype = torch.float
device = torch.device("cpu")
x…

Bendaoud Simou
- 39
- 1
- 9
1
vote
0 answers
How do MLP Classification using Keras
I'm newbie in Neural Network. I'm going to do a text classification research using MLP model with keras. Input layer consisting of 900 nodes, 2 hidden layers, and 2 outputs.
The code I use is as follows:
model = Sequential()
model.add(Dense(units =…

Andryan
- 11
- 2
1
vote
0 answers
Implementing a Basic Neural Network to Perform Classification with Neuroph
I'm very new to neural networks, and decided to try implementing a basic one using Neuroph in Java to perform multiclass classification using Multilayer Perceptron.
public static void main(String[] args) {
final MultiLayerPerceptron…

Twisted Tea
- 49
- 11
1
vote
1 answer
Can someone help explain why my MLP keeps on getting a perfect classification report?
I am using Sklearn.train_test_split and sklearn.MLPClassifier for human activity recognition. Below is my dataset in a pandas df:
a_x a_y a_z g_x g_y g_z activity
0 3.058150 5.524902 -7.415221 0.001280 -0.022299 -0.009420 sit
1 …

JP1990
- 35
- 5
1
vote
0 answers
MLP and LSTM in time series
Hope you are doing well,
I am doing a research paper about wind energy forecasting using deep learning. Where I used 3 neural networks namely: RNN, LSTM, MLP. The results were good, but the thing that I found somewhat strange is the superiority of…

Shamil
- 11
- 2