I’m using Keras through R, and at every epoch it says it has 0 accuracy (accuracy: 0.0000e+00) even through the mae is decreasing. A minimal example of my code is below
x = rnorm(1000)+10
y = x*2
model <- keras_model_sequential() %>%
layer_dense(units = 50, activation = 'relu', input_shape = 1) %>%
layer_dense(units = 50, activation = 'relu') %>%
layer_dense(units = 50, activation = 'relu') %>%
layer_dense(units = 1)
model %>% compile(optimizer = 'rmsprop',
loss = 'mse',
metrics = c('accuracy', 'mae'))
model %>% summary()
model %>% fit(
x = x,
y = y,
epochs = 50,
batch_size = 32,
validation_split = 0.2
)
and when training, I get
Epoch 48/50
25/25 [==============================] - 0s 7ms/step - loss: 5.9464 - accuracy: 0.0000e+00 - mae: 1.9209 - val_loss: 6.8600 - val_accuracy: 0.0000e+00 - val_mae: 2.0744
Epoch 49/50
25/25 [==============================] - 0s 7ms/step - loss: 5.9864 - accuracy: 0.0000e+00 - mae: 1.9232 - val_loss: 7.0626 - val_accuracy: 0.0000e+00 - val_mae: 2.1130
Epoch 50/50
25/25 [==============================] - 0s 7ms/step - loss: 5.9315 - accuracy: 0.0000e+00 - mae: 1.9250 - val_loss: 6.9852 - val_accuracy: 0.0000e+00 - val_mae: 2.1013
is this something to do with it being a single neuron input and single neuron output NN? I have no idea what’s going on. Any help would be great, thanks.