[1c0e03]: / man / reshape_input.Rd

Download this file

35 lines (33 with data), 969 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/create_model_utils.R
\name{reshape_input}
\alias{reshape_input}
\title{Replace input layer}
\usage{
reshape_input(model, input_shape)
}
\arguments{
\item{model}{A keras model.}
\item{input_shape}{The new input shape vector (without batch size).}
}
\value{
A keras model with changed input shape of input model.
}
\description{
Replace first layer of model with new input layer of different shape. Only works for sequential models that
use CNN and LSTM layers.
}
\examples{
\dontshow{if (reticulate::py_module_available("tensorflow")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf}
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
\dontshow{\}) # examplesIf}
}