Extremely slow CNN
I am trying to train a CNN with keras in R. I have a time series that is 3-dimensional, so every sample has dimensions 95 x 365 and has 80 features, which I feed in as channels. The output is only 1 value. The problem is that the net is extremely slow. Training the net for only 1 epoch with 400 samples takes 33 minutes. The architecture is very simple (I actually had a deeper net but since it was so slow I simplified it to see if that helps):
model - keras_model_sequential()
model %%
layer_conv_2d(filters = 32, kernel_size = c(9, 9), activation = "relu",
input_shape = c(95, 365, 80)) %%
layer_max_pooling_2d(pool_size = 2) %%
layer_flatten() %%
layer_dense(units = 50, activation = "relu") %%
layer_dense(units=1)
model %% compile(
loss = 'mse',
optimizer = optimizer_rmsprop()
)
model %% fit(
x_train, y_train,
batch_size = 32,
epochs = 1,
verbose = 0
)
I really do not know what the issue is. I trained simpler networks such as MLPs and the computational time was in a "normal" range, like a few minutes for e.g. 100 epochs. So I guess the problem is not in the hardware I use.
Category Data Science