Questions tagged [mlp]

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

275 questions
3
votes
0 answers

Why is the reported loss different from the mean squared error calculated on the train data?

Why the loss in this code is not equal to the mean squared error in the training data? It should be equal because I set alpha =0 , therefore there is no regularization. import numpy as np import pandas as pd import matplotlib.pyplot as plt from…
Jorge Amaral
  • 131
  • 2
3
votes
2 answers

Neural network only predicts one class from binary class

My task is to learn defected items in a factory. It means, I try to detect defected goods or fine goods. This led a problem where one class dominates the others (one class is 99.7% of the data) as the defected items were very rare. Training accuracy…
junmouse
  • 155
  • 1
  • 9
3
votes
0 answers

error using loss_curve_ attribute of MLPClassifier in python

I am using MLPClassifier in python and I am trying to use the loss_curve_ attribute but I have this error "'MLPClassifier' object has no attribute 'loss_curve_' ". Any ideas of what import I need? I have already tried the "from sklearn import…
2
votes
1 answer

Fitting a MLPRegressor model using GridSearchCV

I'm trying to use GridSearchCV with an MLPRegressor to fit a relationship between my input and output datasets. Does the GridSearchCV.predict() method use the best parameters learned during cross validation or do I need to manually create a new…
2
votes
1 answer

Shape of a numpy array when being passed as an input to Input in Keras

I am reading a book about Deep Learning and I am currently learning about Keras functional API in it. In the context: "The input layer takes a shape argument that is a tuple that indicates the dimensionality of the input data. When input data is…
Richi Dubey
  • 89
  • 12
2
votes
1 answer

Different loss values and accuracies of MLP regressor in keras and scikit-learn

I have a neural network with one hidden layer implemented in both Keras and scikit-learn for solving a regression problem. In scikit-learn I used the MLPregressor class with mostly default parameters and in Keras I have a hidden Dense layer with…
Ross
  • 265
  • 1
  • 3
  • 13
2
votes
2 answers

How can I give string as input in MLP algorithm?

I am implementing MLP Classifier where I want to give string as input. df = pd.DataFrame(results) X = df.iloc[:, [2]].values y = df.iloc[:, [1]].values X_train, X_test, y_train, y_test = train_test_split(X, y) clf = MLPClassifier(random_state=6,…
2
votes
2 answers

Relu Activation and Backpropagation

I have implemented back-propagation for an MLP using the sigmoid activation function. During the forward phase I store the output from each layer in memory. After calculating the output error and output gradient vector I start to go back in reverse…
unaied
  • 197
  • 11
2
votes
0 answers

How to get the coefficient from MLP and other model

I have a question about the coefficient in Multilayer Perceptron (MLP). I have a sample code and data as…
2
votes
0 answers

Why would LSTM with one time step perform better than MLP?

Out of curiosity, I compared a stacked LSTM neural network with a single time step with MLP with tanh activation function, thinking they would have the same performance. The architectures used for comparison are as follows, and they are trained on…
2
votes
2 answers

Difference between "mlp" and "mlpML"

I'm using the Caret package from R to create prediction models for maximum energy demand. What i need to use is neural network multilayer perceptron, but in the Caret package i found out there's 2 of the mlp method, which is "mlp" and "mlpML". what…
user183458
  • 21
  • 4
2
votes
2 answers

GridSearchCV is very slow to estimate my model

I am using GridSearchCV on an MLP Classifier, this is my code... normalized_features.shape # (50000,784) len(labels) # 50000 X_train, X_test, Y_train, Y_test = train_test_split(normalized_features, labels, test_size=0.2) mlp =…
2
votes
0 answers

MLPRegressor error when solver sgd is used

I am building an MLP in python with sklearn.neural_network MLPRegressor. I have a grid search: param_grid={'hidden_layer_sizes': [(100,100), (50,50,50), (100,)], .... 'solver':['adam', 'sgd']} grid=GridSearchCV(MLPRegressor,…
2
votes
1 answer

MLP outputting average of all training output for any input

I have tried to implement a multi layer perceptron with sigmoid activations. Below is the code: import numpy as np def sigmoid(x): return 1.0/(1.0 + np.exp(-x)) def sigmoid_derivative(x): return sigmoid(x) * (1.0 - sigmoid(x)) class MLP: …
2
votes
2 answers

Testing and training data in machine learning

i have more than 2000 data sets for ANN. I have applied MLPRegressor in it. My code is working fine. But for testing, i want to fix my testing value for instance i have 50 data sets. From that i want to test first 20 value. How do I fix this in the…
Sadia Mitu
  • 89
  • 6
1
2
3
18 19