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
14
votes
6 answers

With BERT Text Classification, ValueError: too many dimensions 'str' error occuring

Trying to make a classifier for sentiments of texts with BERT model but getting ValueError : too many dimensions 'str' That is the DataFrame for values of train data; so they are train_labels 0 notr 1 notr 2 notr 3 negative 4 notr ...…
11
votes
1 answer

Using Tensorflow 2.0 and eager execution without Keras

So this question might stem from a lack of knowledge about tensorflow. But I am trying to build a multilayer perceptron with tensorflow 2.0, but without Keras. The reason being that it is a requirement for my machine learning course that we do not…
6
votes
1 answer

How to feed Bert embeddings to LSTM

I am working on a Bert + MLP model for text classification problem. Essentially, I am trying to replace the MLP model with a basic LSTM model. Is it possible to create a LSTM with embedding? Or, is best to create a LSTM with embedded layer? More…
Green
  • 695
  • 2
  • 9
  • 21
5
votes
0 answers

How to visualize model training history using scikit learn's MLP classifier?

I have used the pima-indians-diabetes.csv dataset. I have built a neural network containing architecture 12-8-1 using Keras and I was able to visualize the training history perfectly. Next, I tried to implement the same model using MLPCLassifier…
5
votes
2 answers

Tuning MLPRegressor hyper parameters

I have been trying to tune hyper parameters of a MLP model to solve a regression problem but I always get a convergence warning. This is my code def mlp_model(X, Y): estimator=MLPRegressor() param_grid = {'hidden_layer_sizes': [(50,50,50),…
Y. Gopee
  • 113
  • 1
  • 1
  • 10
4
votes
1 answer

Error when checking input: expected dense_1_input to have 2 dimensions, but got array with shape (25000, 700, 50)

trainData.shape = (25000, 700, 50) , Shape as follows: [[[ 0.7095 0.863 0.712 ... 0.02715 -1.305 0.5195 ] [-0.66 1.715 -1.934 ... 0.5684 0.754 0.2593 ] [-0.3533 2.256 -1.292 ... -0.2708 0.6714 -1.128 ] ... …
user9903583
  • 53
  • 1
  • 4
4
votes
1 answer

Google Colab TPU takes more time than GPU

Below is the code I am using. I commented out the line to convert my model to the TPU model. With GPU for the same amount of data it's taking 7 seconds for an epoch while using TPU it takes 90 secs. Inp = tf.keras.Input(name='input',…
mihirjoshi
  • 12,161
  • 7
  • 47
  • 78
3
votes
2 answers

Why don't LogisticRegression and MLPClassifier produce the same results?

A neural network with no hidden layers and sigmoid/softmax activation is just logistic regression: from sklearn.datasets import load_iris from sklearn.neural_network import MLPClassifier from sklearn.linear_model import LogisticRegression X, y =…
invictus
  • 1,821
  • 3
  • 25
  • 30
3
votes
1 answer

Fluentbit - parsing log with multiple format (log+json)

I'm trying to send to elasticsearch the following log line through fluentbit, but I didn't find the right solution to extract both time and the json structure after the [MLP] part: 2020-12-29 08:00:03,230 INFO [http-nio-3410-exec-7]…
Meekly
  • 31
  • 2
3
votes
3 answers

MLP with Scikitlearn: Artificial Neural Network application for forecast

I have traffic data and I want to predict number of vehicles for the next hour by showing the model these inputs: this hour's number of vehicles and this hour's average speed value. Here is my code: dataset=pd.read_csv('/content/final -…
3
votes
1 answer

Error when trying to tune MLPClassifier hidden_layer_sizes using BayesSearchCV

When trying to tune the sklearn MLPClassifier hidden_layer_sizes hyper parameter, using BayesSearchCV, I get an error: ValueError: can only convert an array of size 1 to a Python scalar. However, when I use GridSearchCV, it works great! What am I…
onofricamila
  • 930
  • 1
  • 11
  • 20
3
votes
2 answers

MLPRegressor working but results don't make any sense

I am building a neural network with my research data in two ways: with a statistical programm (SPSS) and with python. I am using the scikit learn MLPRegressor. The problem I have is that whereas my code is , apparently, well written (because it…
3
votes
1 answer

AttributeError: 'MLPClassifier' object has no attribute 'best_loss_'

I was experimenting with the warm_start parameter in scikit-learn's MLPClassifier. However, I received an error while running the following code. clf = MLPClassifier(solver='adam', hidden_layer_sizes=(128, 128), …
3
votes
1 answer

How does sklearn's MLP predict_proba function work internally?

I am trying to understand how sklearn's MLP Classifier retrieves its results for its predict_proba function. The website simply lists: Probability estimates While many others, such as logistic regression, have more detailed answers: Probability…
artemis
  • 6,857
  • 11
  • 46
  • 99
3
votes
0 answers

K Fold Cross validation in MLP

I want to implement the cross validation in the MLP Regressor in my data set. I want to know if my code is correct or not? Is this the way to cross validate? Here is my sample data: Wavelength Phase_velocity Shear_wave_velocity 1.50 …
Sadia Mitu
  • 89
  • 6
1
2 3
18 19