How to get class prediction for new entry value in neural networks?

Advertisements I am new to Nerual Networks model building !! I am doing an multi-class text classification using neural networks. Steps I have done : 1.Data Cleaning 2.Keras – Text Vectorization for Input Data 3.Dummie values for Label data I have build the model like this: model = tf.keras.Sequential([ layers.Embedding(max_features + 1, embedding_dim), layers.Dropout(0.2), layers.GlobalAveragePooling1D(),… Read More How to get class prediction for new entry value in neural networks?

IndexError: index 4 is out of bounds for dimension 0 with size 4?

Advertisements I am tying to write a NN in pytorch that learns to give for example: very simple A+B for two images. Writing it, I got this error. my batch_size is 4. class myNet(nn.Module): def __init__(self): super(myNet, self).__init__() self.fc1 = nn.Linear(3072, 3072) # set up FC layer self.fc2 = nn.Linear(3072, 3072) # set up the… Read More IndexError: index 4 is out of bounds for dimension 0 with size 4?

problem when loading a keras model saved through a wrapper class

Advertisements I have the following wrapper class: from tensorflow.keras.models import Sequential class NeuralNet(Sequential): def __init__(self, **kwargs): super().__init__(**kwargs) I can fit and save the model without problems, but when I try to load it: from tensorflow.keras.models import load_model model = load_model(‘model.h5’) I get: –> 296 raise ValueError(‘Unknown ‘ + printable_module_name + ‘: ‘ + class_name) 297… Read More problem when loading a keras model saved through a wrapper class

np.random.rand somehow produces floats bigger than 1 [solved, it doesn't]

Advertisements I’m trying to create a 2-layer neural network, for that I first initialize weights and biases to random floats between 0 an 1 using numpy.random.rand. However, for some reason this process produces floats bigger than 1 for W1 (weight 1) whereas it works correctly for all other weights an biases. I can’t understand why… Read More np.random.rand somehow produces floats bigger than 1 [solved, it doesn't]