Slow keras fit method with 100x100 array, how can I make it faster?
using a 50 x 50 matrix I get 2500 cells, and in the construction of the neural network I have a 2500x2500 parameters + 2500 for a total of 6252500.
I think that slows down operations.
and there are only 3 Danse layers, the last one is size 4 because of the possible actions that are 4.
Is it possible to reduce the time of operation by adding more Danse layers?
this is my model
def build_model(env, **opt):
loss = opt.get('loss', 'mse')
a = opt.get('alpha', 0.24)
model = Sequential()
esize = env.maze.size
model.add(Dense(esize, input_shape=(esize,)))
model.add(LeakyReLU(alpha=a))
model.add(Dense(esize))
model.add(LeakyReLU(alpha=a))
model.add(Dense(num_actions))
model.compile(optimizer='adam', loss='mse')
return model