Hello!
I tried to create a neural network with keras and the glove embedding.
model <- keras_model_sequential() %>%
layer_embedding(input_dim = num_words, output_dim = embedding_dim,
input_length = max_length) %>%
layer_flatten() %>%
layer_dense(units = 32, activation = "relu") %>%
layer_dense(units = 1, activation = "sigmoid")
get_layer(model, index = 1) %>%
set_weights(list(embedding_matrix)) %>%
freeze_weights()
I am able to use the compile function, however, I get the following error message when I try to use the fit function:
Error in UseMethod("fit"): no applicable method for 'fit' applied to an object of class "c('keras.engine.sequential.Sequential', 'keras.engine.functional.Functional', 'keras.engine.training.Model', 'keras.engine.base_layer.Layer', 'tensorflow.python.module.module.Module', 'tensorflow.python.training.tracking.tracking.AutoTrackable', 'tensorflow.python.training.tracking.base.Trackable', 'keras.utils.version_utils.LayerVersionSelector', 'keras.utils.version_utils.ModelVersionSelector', 'python.builtin.object')"
Also, for the evaluation I get an error:
Error in py_call_impl(callable, dots$args, dots$keywords): ValueError: in user code:
I am looking forward to your help.