neural-network

How to save tensorflow neural networks at custom intervals

How to save tensorflow neural networks at custom intervals Question: I want to save my neural network such that I can make a video on how the neural network trains (plotting results throughout the training process). Since the most difference in results occur at the start, I would like to save the model more often …

Total answers: 1

How to get a flattened view of PyTorch model parameters?

How to get a flattened view of PyTorch model parameters? Question: I want to have a flattened view of the parameters belonging to my Pytorch model. Note it should be a view and not a copy of the parameters. In other words, when I modify the parameters in the view it should also modify the …

Total answers: 1

Kears LeNet High Training & Validation accuracy but Low Testing accuracy

Kears LeNet High Training & Validation accuracy but Low Testing accuracy Question: I am trying to train the mnist database using the LeNet Architecture. I downloaded the mnist_png images from github (https://github.com/myleott/mnist_png) and it had over 50000 images. I am trying to build a LeNet model for the prediction of handwritten numbers using the LeNet …

Total answers: 2

Bound label to Image

Bound label to Image Question: From the mnist dataset example I know that the dataset look something like this (60000,28,28) and the labels are (60000,). When, I print the first three examples of Mnist dataset and I print the first three labels of those which are: The images and labels are bounded. I want to …

Total answers: 1

LSTM predicts mean value, how to solve this?

LSTM predicts mean value, how to solve this? Question: EDIT: Thank you guys for all your input, I’m not sure if the case is resolved but it seems so. In my former Data preparation function I have shuffled the training sequences, which resulted in LSTM predicting an average. I was browsing the internet and I …

Total answers: 2

What is a good way to predict psuedo random numbers with neural networks?

What is a good way to predict pseudo random numbers with neural networks? Question: Today I tried to see if a neural network could predict the next random number generated from a sequence of 20 previous random numbers. However, when I actually predicted using the model it simply returned the most common number. I’m very …

Total answers: 1

How to make separate Keras model with dependent weights?

How to make separate Keras model with dependent weights? Question: I have to create a network with keras like in the picture below, where NN – individual neural networks. The problem is, that they all must have same weights I can’t use shared layers (at least to my understanding), because then one network will get …

Total answers: 1

Gradient Descent with objective loss backpropagation does not minimize loss

Gradient Descent with objective loss backpropagation does not minimize loss Question: I have this code below for my implementation of a gradient descent: class Neuron(): def __init__(self): #Generate random weight self.weights = [np.random.rand() for _ in range(4)] self.learning_rate = 0.1 @staticmethod def activation_func(z): return ((math.e ** z) – (math.e ** (-z)))/((math.e ** z) + (math.e …

Total answers: 3

How Do I separate labels and images?

How Do I separate labels and images? Question: I am loading a dataset of handwritten images import numpy as np import matplotlib.pyplot as plt from tensorflow import keras from tensorflow.keras import layers train_data= np.loadtxt(‘train.txt’) print(‘train:’,train_data.shape) ##train (7291, 257) The first digit of each row is a digit from 0-9(labels), and the rest 256 are images. …

Total answers: 2