reshape_input: Replace input layer

View source: R/create_model_utils.R

reshape_inputR Documentation

Replace input layer

Description

Replace first layer of model with new input layer of different shape. Only works for sequential models that use CNN and LSTM layers.

Usage

reshape_input(model, input_shape)

Arguments

model

A keras model.

input_shape

The new input shape vector (without batch size).

Value

A keras model with changed input shape of input model.

Examples


model_1 <-  create_model_lstm_cnn(
  maxlen = 50,
  kernel_size = c(10, 10),
  filters = c(64, 128),
  pool_size = c(2, 2),
  layer_lstm = c(32),
  verbose = FALSE,
  layer_dense = c(64, 2))
model <- reshape_input(model_1, input_shape = c(120, 4))
model


GenomeNet/deepG documentation built on Dec. 24, 2024, 12:11 p.m.