Struct RNNCellOptions¶
Defined in File rnn.h
Page Contents
Struct Documentation¶
-
struct RNNCellOptions¶
Options for the
RNNCell
module.Example:
RNNCell model(RNNCellOptions(20, 10).bias(false).nonlinearity(torch::kReLU));
Public Functions
-
RNNCellOptions(int64_t input_size, int64_t hidden_size)¶
-
inline auto input_size(const int64_t &new_input_size) -> decltype(*this)¶
The number of expected features in the input
x
-
inline auto input_size(int64_t &&new_input_size) -> decltype(*this)¶
-
inline const int64_t &input_size() const noexcept¶
-
inline int64_t &input_size() noexcept¶
The number of features in the hidden state
h
-
inline auto bias(const bool &new_bias) -> decltype(*this)¶
If
false
, then the layer does not use bias weightsb_ih
andb_hh
.Default:
true
-
inline auto bias(bool &&new_bias) -> decltype(*this)¶
-
inline const bool &bias() const noexcept¶
-
inline bool &bias() noexcept¶
-
inline auto nonlinearity(const nonlinearity_t &new_nonlinearity) -> decltype(*this)¶
The non-linearity to use.
Can be either
torch::kTanh
ortorch::kReLU
. Default:torch::kTanh
-
inline auto nonlinearity(nonlinearity_t &&new_nonlinearity) -> decltype(*this)¶
-
inline const nonlinearity_t &nonlinearity() const noexcept¶
-
inline nonlinearity_t &nonlinearity() noexcept¶
-
RNNCellOptions(int64_t input_size, int64_t hidden_size)¶