kerasR
kerasR copied to clipboard
I am getting this error
TypeError: Value passed to parameter 'shape' has DataType float32 not in list of allowed values: int32, int64
`LSTM_ <- function (X_train,Y_train){
X_train <- data.matrix(X_train) X_train <- k_expand_dims(X_train, axis = 3) X_train <- K$eval(X_train) Y_train <- data.matrix(Y_train) batch_size <- 10 num_samples <- dim(X_train)[1] num_steps <- dim(X_train)[2] num_features <- dim(X_train)[3] c(num_samples, num_steps, num_features) model <- Sequential() input_shape=c(num_steps, num_features) model$add(LSTM(units = 4, input_shape=input_shape))) model$add(Dense(1)) keras_compile(model, loss='mean_squared_error', optimizer='adam') keras_fit(model, X_train, Y_train, batch_size = 1, epochs = 500, verbose = 1)
}`
My data set has dimension , after applying k_expand_dim is (95,15,1) and my input_shape is (15,1)
Could you please provide a minimally working example? I cannot debug this based on the snippet of code alone.