Category "neural-network"

The method np_utils.to_categorical give me an error

np_utils.to_categorical Keras method give me an error when i gived it a a vector of [962] element which contain 3 classes [1,1,1,...,2,2,2,...3,3,3]. The used

Moving averaging of Loss during Training in Keras

I am using Keras with TensorFlow to implement a deep neural network. When I plot the loss and number of iterations, there is a significant jump in loss after ea

Missing val_acc after fitting sequential model

I am missing information about the 'val_acc' attribute when I fit a compiled sequential model. I have a sequential model that is compiled with 'accuracy' metr

ValueError: Input 0 of layer hiddenL1 is incompatible with the layer: its rank is undefined, but the layer requires a define rank

I am trying to create a sequential keras model with custom weights. The weights come from a row in a numpy array. When running the code I get the error: Value

Early stopping in Bert Trainer instances

I am fine tuning a BERT model for a multiclass classification task. My problem is that I don't know how to add "early stopping" to those Trainer instances. Any

How to define a specific keras layer weight as non-trainable?

Let's suppose we have a neural nets with three layers : Inputs > Hidden > Outputs and consider that the weigths between the Hidden and Outputs layers are

One box object detection

I am using a faster rcnn model to predict one object in an image. There can only be one object in each image. Is it possible to force Faster Rcnn to train and p

Google Colab GPU RAM depletes quickly on test data but not so on training data

I am training my neural network built with PyTorch under Google Colab Pro+ (Tesla P100-PCIE GPU) but encounters the following strange phenomenon: The amount of

How to save the model weights after running train_detector in mmdetection?

cfg.optimizer.lr = 0.02 / 8 cfg.lr_config.warmup = None cfg.log_config.interval = 600 # Change the evaluation metric since we use customized dataset. cfg.evalua

How does keras.evaluate() calculate the loss?

I am building a MLP using TensorFlow 2.0. I am plotting the learning curve and also using keras.evaluate on both training and test data to see how well it perfo

Can I unpack an `nn.ModuleList` inside `nn.Sequential`?

I am parametrizing the number of hidden layers of a simple ANN using nn.ModuleList. I am wondering if passing this list into a nn.Sequential module as follows w

Plot the Decision Boundary of a Neural Network in PyTorch

I've been trying to plot the decision boundary of my neural network which I used for binary classification with the sigmoid function in the output layer but wit

got nan in keras tuner but it works when I train it

I trained my network several times and I already got some results. Then I found out about the Keras tuner and wanted to find the best hyperparameters with it. b

TypeError: __init__() missing 1 required positional argument: 'units' while coding an neural net

import pandas as pd import numpy as np from sklearn.preprocessing import StandardScaler from keras import Sequential from tensorflow.keras.layers import Dense f

Audio resampling layer for tensorflow

It is required to resample audio signals within a custom model structure. This resampling task is not a kind of pre/post-processing operation that can be develo

How to train LSTM model with variable-length sequence input

I'm trying to train LSTM model in Keras using data of variable timestep, for example, the data looks like: <tf.RaggedTensor [[[0.0, 0.0, 0.0, 0.0, 0.0, 1.0,

Tensorflow - Value Error in model.fit - How to fix

I am trying to train a Deep Neural Network using MNIST data set. BATCH_SIZE = 100 train_data = train_data.batch(BATCH_SIZE) validation_data = validation_data.b

How to change activation layer in Pytorch pretrained module?

How to change the activation layer of a Pytorch pretrained network? Here is my code : print("All modules") for child in net.children(): if isinstance(chi

In keras/ tensorflow, Is there a way to add a preprocessing layer to the output, similar to TargetTransformRegressor in sklearn?

I want to use keras to build a neural network regression model from X_train -> Y_train. In this example, however, I need to perform a preprocessing transform

Matrix multiplication in TensorFlow model

I want to use matrix multiplication inside TF model. My model is a NN with input shape = (1,9). And I want to get a product of this vectors by themself (i.e. I