|
using | system_tag = SystemTag |
|
using | value_type = ValueType |
|
using | input_descriptor_t = Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > |
|
using | parent_type = Layer_Base< LSTM< SystemTag, ValueType, Optimizer, ForgetGateNonlinearity, WriteGateNonlinearity, InputGateNonlinearity, OutputGateNonlinearity, CellStateNonLinearity >, input_descriptor_t > |
|
using | allocator_type = nn_default_allocator_type< ValueType, SystemTag > |
|
using | optimizer_type = Optimizer |
|
using | greedy_evaluate_delta = std::true_type |
|
using | forward_requires_outputs = std::true_type |
|
using | backward_requires_outputs = std::true_type |
|
using | requires_extra_cache = std::true_type |
|
using | is_recurrent = std::true_type |
|
using | defines_predict = std::true_type |
|
using | defines_single_predict = std::true_type |
|
using | value_type = typename Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > ::value_type |
|
using | system_tag = typename Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > ::system_tag |
|
using | allocator_type = typename Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > ::allocator_type |
|
using | input_tensor_dim = typename Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > ::tensor_dim |
|
using | shape_type = bc::Dim< input_tensor_dim::value > |
|
using | input_tensor_type = typename Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > ::type |
|
using | batched_input_tensor_type = typename Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > ::batched_type |
|
using | output_value_type = typename Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > ::value_type |
|
using | output_system_tag = typename Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > ::system_tag |
|
using | output_allocator_type = typename Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > ::allocator_type |
|
using | output_tensor_dim = typename Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > ::tensor_dim |
|
using | output_shape_type = bc::Dim< output_tensor_dim::value > |
|
using | output_tensor_type = typename Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > ::type |
|
using | batched_output_tensor_type = typename Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > ::batched_type |
|
using | output_value_type = typename Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > ::value_type |
|
using | output_value_type = typename Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > ::value_type |
|
using | output_system_tag = typename Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > ::system_tag |
|
using | output_system_tag = typename Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > ::system_tag |
|
using | output_allocator_type = typename Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > ::allocator_type |
|
using | output_allocator_type = typename Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > ::allocator_type |
|
using | output_tensor_dim = typename Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > ::tensor_dim |
|
using | output_tensor_dim = typename Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > ::tensor_dim |
|
using | output_shape_type = bc::Dim< output_tensor_dim::value > |
|
using | output_shape_type = typename Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > ::shape_type |
|
using | output_tensor_type = typename Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > ::type |
|
using | output_tensor_type = typename Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > ::tensor_type |
|
using | batched_output_tensor_type = typename Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > ::batched_type |
|
using | batched_output_tensor_type = typename Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > ::batched_type |
|
using | next_layer_type = Layer_Input_Base< Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > > |
|
using | next_layer_type = Layer_Input_Base< Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > > |
|
|
| LSTM (int inputs, bc::size_t outputs) |
|
void | randomize_weights () |
|
template<class X , class Y > |
auto | forward_propagation (const X &x, const Y &y, Cache &cache) |
|
template<class X , class Y > |
auto | predict (const X &x, const Y &y, Cache &cache) |
|
template<class X , class Y > |
auto | single_predict (const X &x, const Y &y, Cache &cache) |
|
template<class X , class Y , class Delta > |
auto | back_propagation (const X &x, const Y &y, const Delta &delta_outputs, class Cache &cache) |
|
void | update_weights () |
|
virtual void | set_learning_rate_hook (value_type lr) override final |
|
virtual void | set_batch_size_hook (int bs) override final |
|
void | zero_deltas () |
|
void | zero_gradients () |
|
void | clear_bp_storage (Cache &m_cache) |
|
virtual void | save (Layer_Loader &loader) const |
|
virtual void | save_from_cache (Layer_Loader &loader, const Cache &cache) const override |
|
virtual void | load (Layer_Loader &loader) override |
|
virtual void | load_to_cache (Layer_Loader &loader, const Cache &cache) override |
|
void | copy_training_data_to_single_predict (Cache &cache, int batch_index) |
|
| Layer_Base (std::string classname, shape_type input_shape, output_shape_type output_shape) |
| m_classname should be initialized by supplying __func__ to the first argument of the Layer_Base. More...
|
|
| Layer_Base (std::string classname, shape_type input_shape) |
|
virtual | ~Layer_Base () |
|
virtual output_shape_type | get_output_shape () const |
|
virtual shape_type | get_input_shape () const |
|
auto | get_batched_input_shape () const |
|
auto | get_batched_output_shape () const |
|
bc::size_t | input_size () const |
|
bc::size_t | output_size () const |
|
bc::size_t | batch_size () const |
|
bc::size_t | batched_input_size () const |
|
bc::size_t | batched_output_size () const |
|
void | set_batch_size (int batch_size) |
|
void | set_learning_rate (value_type learning_rate) |
|
auto | get_learning_rate () const |
|
auto | get_batched_learning_rate () const |
|
void | copy_training_data_to_single_predict (Cache &, int batch_index) |
|
void | update_weights () |
|
void | clear_bp_storage (Cache &) |
|
const std::string & | classname () const |
| Returns the derived_classes class namepse. More...
|
|
std::string | get_string_architecture () const |
|
virtual std::string | get_string_architecture_hook () const |
|
auto | default_input_tensor_factory () const |
|
auto | default_output_tensor_factory () const |
|
auto | default_batched_input_tensor_factory () const |
|
auto | default_batched_output_tensor_factory () const |
|
void | set_prev (prev_layer_type &prev) |
|
void | set_prev (prev_layer_type &prev) |
|
input_shape_type | input_shape () const |
|
input_shape_type | input_shape () const |
|
const prev_layer_type & | prev_layer () const |
|
prev_layer_type & | prev_layer () |
|
const prev_layer_type & | prev_layer () const |
|
prev_layer_type & | prev_layer () |
|
virtual | ~Layer_Input_Base () |
|
virtual | ~Layer_Input_Base () |
|
void | set_next (next_layer_type &next) |
|
void | set_next (next_layer_type &next) |
|
output_shape_type | output_shape () const |
|
output_shape_type | output_shape () const |
|
const next_layer_type & | next_layer () const |
|
next_layer_type & | next_layer () |
|
const next_layer_type & | next_layer () const |
|
next_layer_type & | next_layer () |
|
virtual | ~Layer_Output_Base () |
|
virtual | ~Layer_Output_Base () |
|
template<class SystemTag , class ValueType , class Optimizer = Stochastic_Gradient_Descent, class ForgetGateNonlinearity = bc::Logistic, class WriteGateNonlinearity = bc::Tanh, class InputGateNonlinearity = bc::Logistic, class OutputGateNonlinearity = bc::Logistic, class CellStateNonLinearity = bc::Tanh>
using bc::nn::LSTM< SystemTag, ValueType, Optimizer, ForgetGateNonlinearity, WriteGateNonlinearity, InputGateNonlinearity, OutputGateNonlinearity, CellStateNonLinearity >::is_recurrent = std::true_type |
template<class SystemTag , class ValueType , class Optimizer = Stochastic_Gradient_Descent, class ForgetGateNonlinearity = bc::Logistic, class WriteGateNonlinearity = bc::Tanh, class InputGateNonlinearity = bc::Logistic, class OutputGateNonlinearity = bc::Logistic, class CellStateNonLinearity = bc::Tanh>
using bc::nn::LSTM< SystemTag, ValueType, Optimizer, ForgetGateNonlinearity, WriteGateNonlinearity, InputGateNonlinearity, OutputGateNonlinearity, CellStateNonLinearity >::system_tag = SystemTag |
template<class SystemTag , class ValueType , class Optimizer = Stochastic_Gradient_Descent, class ForgetGateNonlinearity = bc::Logistic, class WriteGateNonlinearity = bc::Tanh, class InputGateNonlinearity = bc::Logistic, class OutputGateNonlinearity = bc::Logistic, class CellStateNonLinearity = bc::Tanh>
using bc::nn::LSTM< SystemTag, ValueType, Optimizer, ForgetGateNonlinearity, WriteGateNonlinearity, InputGateNonlinearity, OutputGateNonlinearity, CellStateNonLinearity >::value_type = ValueType |
template<class SystemTag , class ValueType , class Optimizer = Stochastic_Gradient_Descent, class ForgetGateNonlinearity = bc::Logistic, class WriteGateNonlinearity = bc::Tanh, class InputGateNonlinearity = bc::Logistic, class OutputGateNonlinearity = bc::Logistic, class CellStateNonLinearity = bc::Tanh>
template<class X , class Y , class Delta >
auto bc::nn::LSTM< SystemTag, ValueType, Optimizer, ForgetGateNonlinearity, WriteGateNonlinearity, InputGateNonlinearity, OutputGateNonlinearity, CellStateNonLinearity >::back_propagation |
( |
const X & |
x, |
|
|
const Y & |
y, |
|
|
const Delta & |
delta_outputs, |
|
|
class Cache & |
cache |
|
) |
| |
|
inline |
template<class SystemTag , class ValueType , class Optimizer = Stochastic_Gradient_Descent, class ForgetGateNonlinearity = bc::Logistic, class WriteGateNonlinearity = bc::Tanh, class InputGateNonlinearity = bc::Logistic, class OutputGateNonlinearity = bc::Logistic, class CellStateNonLinearity = bc::Tanh>
void bc::nn::LSTM< SystemTag, ValueType, Optimizer, ForgetGateNonlinearity, WriteGateNonlinearity, InputGateNonlinearity, OutputGateNonlinearity, CellStateNonLinearity >::clear_bp_storage |
( |
Cache & |
m_cache | ) |
|
|
inline |
template<class SystemTag , class ValueType , class Optimizer = Stochastic_Gradient_Descent, class ForgetGateNonlinearity = bc::Logistic, class WriteGateNonlinearity = bc::Tanh, class InputGateNonlinearity = bc::Logistic, class OutputGateNonlinearity = bc::Logistic, class CellStateNonLinearity = bc::Tanh>
void bc::nn::LSTM< SystemTag, ValueType, Optimizer, ForgetGateNonlinearity, WriteGateNonlinearity, InputGateNonlinearity, OutputGateNonlinearity, CellStateNonLinearity >::copy_training_data_to_single_predict |
( |
Cache & |
cache, |
|
|
int |
batch_index |
|
) |
| |
|
inline |
template<class SystemTag , class ValueType , class Optimizer = Stochastic_Gradient_Descent, class ForgetGateNonlinearity = bc::Logistic, class WriteGateNonlinearity = bc::Tanh, class InputGateNonlinearity = bc::Logistic, class OutputGateNonlinearity = bc::Logistic, class CellStateNonLinearity = bc::Tanh>
template<class X , class Y >
auto bc::nn::LSTM< SystemTag, ValueType, Optimizer, ForgetGateNonlinearity, WriteGateNonlinearity, InputGateNonlinearity, OutputGateNonlinearity, CellStateNonLinearity >::forward_propagation |
( |
const X & |
x, |
|
|
const Y & |
y, |
|
|
Cache & |
cache |
|
) |
| |
|
inline |
template<class SystemTag , class ValueType , class Optimizer = Stochastic_Gradient_Descent, class ForgetGateNonlinearity = bc::Logistic, class WriteGateNonlinearity = bc::Tanh, class InputGateNonlinearity = bc::Logistic, class OutputGateNonlinearity = bc::Logistic, class CellStateNonLinearity = bc::Tanh>
virtual void bc::nn::LSTM< SystemTag, ValueType, Optimizer, ForgetGateNonlinearity, WriteGateNonlinearity, InputGateNonlinearity, OutputGateNonlinearity, CellStateNonLinearity >::load |
( |
Layer_Loader & |
loader | ) |
|
|
inlineoverridevirtual |
Reimplemented from bc::nn::Layer_Base< LSTM< SystemTag, ValueType, Optimizer, ForgetGateNonlinearity, WriteGateNonlinearity, InputGateNonlinearity, OutputGateNonlinearity, CellStateNonLinearity >, Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > >.
template<class SystemTag , class ValueType , class Optimizer = Stochastic_Gradient_Descent, class ForgetGateNonlinearity = bc::Logistic, class WriteGateNonlinearity = bc::Tanh, class InputGateNonlinearity = bc::Logistic, class OutputGateNonlinearity = bc::Logistic, class CellStateNonLinearity = bc::Tanh>
virtual void bc::nn::LSTM< SystemTag, ValueType, Optimizer, ForgetGateNonlinearity, WriteGateNonlinearity, InputGateNonlinearity, OutputGateNonlinearity, CellStateNonLinearity >::load_to_cache |
( |
Layer_Loader & |
loader, |
|
|
const Cache & |
cache |
|
) |
| |
|
inlineoverridevirtual |
Reimplemented from bc::nn::Layer_Base< LSTM< SystemTag, ValueType, Optimizer, ForgetGateNonlinearity, WriteGateNonlinearity, InputGateNonlinearity, OutputGateNonlinearity, CellStateNonLinearity >, Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > >.
template<class SystemTag , class ValueType , class Optimizer = Stochastic_Gradient_Descent, class ForgetGateNonlinearity = bc::Logistic, class WriteGateNonlinearity = bc::Tanh, class InputGateNonlinearity = bc::Logistic, class OutputGateNonlinearity = bc::Logistic, class CellStateNonLinearity = bc::Tanh>
template<class X , class Y >
auto bc::nn::LSTM< SystemTag, ValueType, Optimizer, ForgetGateNonlinearity, WriteGateNonlinearity, InputGateNonlinearity, OutputGateNonlinearity, CellStateNonLinearity >::predict |
( |
const X & |
x, |
|
|
const Y & |
y, |
|
|
Cache & |
cache |
|
) |
| |
|
inline |
template<class SystemTag , class ValueType , class Optimizer = Stochastic_Gradient_Descent, class ForgetGateNonlinearity = bc::Logistic, class WriteGateNonlinearity = bc::Tanh, class InputGateNonlinearity = bc::Logistic, class OutputGateNonlinearity = bc::Logistic, class CellStateNonLinearity = bc::Tanh>
void bc::nn::LSTM< SystemTag, ValueType, Optimizer, ForgetGateNonlinearity, WriteGateNonlinearity, InputGateNonlinearity, OutputGateNonlinearity, CellStateNonLinearity >::randomize_weights |
( |
| ) |
|
|
inline |
template<class SystemTag , class ValueType , class Optimizer = Stochastic_Gradient_Descent, class ForgetGateNonlinearity = bc::Logistic, class WriteGateNonlinearity = bc::Tanh, class InputGateNonlinearity = bc::Logistic, class OutputGateNonlinearity = bc::Logistic, class CellStateNonLinearity = bc::Tanh>
virtual void bc::nn::LSTM< SystemTag, ValueType, Optimizer, ForgetGateNonlinearity, WriteGateNonlinearity, InputGateNonlinearity, OutputGateNonlinearity, CellStateNonLinearity >::save |
( |
Layer_Loader & |
loader | ) |
const |
|
inlinevirtual |
Reimplemented from bc::nn::Layer_Base< LSTM< SystemTag, ValueType, Optimizer, ForgetGateNonlinearity, WriteGateNonlinearity, InputGateNonlinearity, OutputGateNonlinearity, CellStateNonLinearity >, Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > >.
template<class SystemTag , class ValueType , class Optimizer = Stochastic_Gradient_Descent, class ForgetGateNonlinearity = bc::Logistic, class WriteGateNonlinearity = bc::Tanh, class InputGateNonlinearity = bc::Logistic, class OutputGateNonlinearity = bc::Logistic, class CellStateNonLinearity = bc::Tanh>
virtual void bc::nn::LSTM< SystemTag, ValueType, Optimizer, ForgetGateNonlinearity, WriteGateNonlinearity, InputGateNonlinearity, OutputGateNonlinearity, CellStateNonLinearity >::save_from_cache |
( |
Layer_Loader & |
loader, |
|
|
const Cache & |
cache |
|
) |
| const |
|
inlineoverridevirtual |
Reimplemented from bc::nn::Layer_Base< LSTM< SystemTag, ValueType, Optimizer, ForgetGateNonlinearity, WriteGateNonlinearity, InputGateNonlinearity, OutputGateNonlinearity, CellStateNonLinearity >, Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > >.
template<class SystemTag , class ValueType , class Optimizer = Stochastic_Gradient_Descent, class ForgetGateNonlinearity = bc::Logistic, class WriteGateNonlinearity = bc::Tanh, class InputGateNonlinearity = bc::Logistic, class OutputGateNonlinearity = bc::Logistic, class CellStateNonLinearity = bc::Tanh>
virtual void bc::nn::LSTM< SystemTag, ValueType, Optimizer, ForgetGateNonlinearity, WriteGateNonlinearity, InputGateNonlinearity, OutputGateNonlinearity, CellStateNonLinearity >::set_batch_size_hook |
( |
int |
bs | ) |
|
|
inlinefinaloverridevirtual |
Reimplemented from bc::nn::Layer_Base< LSTM< SystemTag, ValueType, Optimizer, ForgetGateNonlinearity, WriteGateNonlinearity, InputGateNonlinearity, OutputGateNonlinearity, CellStateNonLinearity >, Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > >.
template<class SystemTag , class ValueType , class Optimizer = Stochastic_Gradient_Descent, class ForgetGateNonlinearity = bc::Logistic, class WriteGateNonlinearity = bc::Tanh, class InputGateNonlinearity = bc::Logistic, class OutputGateNonlinearity = bc::Logistic, class CellStateNonLinearity = bc::Tanh>
virtual void bc::nn::LSTM< SystemTag, ValueType, Optimizer, ForgetGateNonlinearity, WriteGateNonlinearity, InputGateNonlinearity, OutputGateNonlinearity, CellStateNonLinearity >::set_learning_rate_hook |
( |
value_type |
lr | ) |
|
|
inlinefinaloverridevirtual |
Reimplemented from bc::nn::Layer_Base< LSTM< SystemTag, ValueType, Optimizer, ForgetGateNonlinearity, WriteGateNonlinearity, InputGateNonlinearity, OutputGateNonlinearity, CellStateNonLinearity >, Tensor_Descriptor< ValueType, SystemTag, Integer< 1 > > >.
template<class SystemTag , class ValueType , class Optimizer = Stochastic_Gradient_Descent, class ForgetGateNonlinearity = bc::Logistic, class WriteGateNonlinearity = bc::Tanh, class InputGateNonlinearity = bc::Logistic, class OutputGateNonlinearity = bc::Logistic, class CellStateNonLinearity = bc::Tanh>
template<class X , class Y >
auto bc::nn::LSTM< SystemTag, ValueType, Optimizer, ForgetGateNonlinearity, WriteGateNonlinearity, InputGateNonlinearity, OutputGateNonlinearity, CellStateNonLinearity >::single_predict |
( |
const X & |
x, |
|
|
const Y & |
y, |
|
|
Cache & |
cache |
|
) |
| |
|
inline |
template<class SystemTag , class ValueType , class Optimizer = Stochastic_Gradient_Descent, class ForgetGateNonlinearity = bc::Logistic, class WriteGateNonlinearity = bc::Tanh, class InputGateNonlinearity = bc::Logistic, class OutputGateNonlinearity = bc::Logistic, class CellStateNonLinearity = bc::Tanh>
void bc::nn::LSTM< SystemTag, ValueType, Optimizer, ForgetGateNonlinearity, WriteGateNonlinearity, InputGateNonlinearity, OutputGateNonlinearity, CellStateNonLinearity >::update_weights |
( |
| ) |
|
|
inline |
template<class SystemTag , class ValueType , class Optimizer = Stochastic_Gradient_Descent, class ForgetGateNonlinearity = bc::Logistic, class WriteGateNonlinearity = bc::Tanh, class InputGateNonlinearity = bc::Logistic, class OutputGateNonlinearity = bc::Logistic, class CellStateNonLinearity = bc::Tanh>
void bc::nn::LSTM< SystemTag, ValueType, Optimizer, ForgetGateNonlinearity, WriteGateNonlinearity, InputGateNonlinearity, OutputGateNonlinearity, CellStateNonLinearity >::zero_deltas |
( |
| ) |
|
|
inline |
template<class SystemTag , class ValueType , class Optimizer = Stochastic_Gradient_Descent, class ForgetGateNonlinearity = bc::Logistic, class WriteGateNonlinearity = bc::Tanh, class InputGateNonlinearity = bc::Logistic, class OutputGateNonlinearity = bc::Logistic, class CellStateNonLinearity = bc::Tanh>
void bc::nn::LSTM< SystemTag, ValueType, Optimizer, ForgetGateNonlinearity, WriteGateNonlinearity, InputGateNonlinearity, OutputGateNonlinearity, CellStateNonLinearity >::zero_gradients |
( |
| ) |
|
|
inline |