![]() |
ceras
yet another deep learning engine
|
#include <model.hpp>
Public Types | |
| typedef Ph | input_layer_type |
| typedef Ex | output_layer_type |
Public Member Functions | |
| input_layer_type | input () const noexcept |
| output_layer_type | output () const noexcept |
| model (input_layer_type const &place_holder, output_layer_type const &expression) | |
| template<Tensor Tsor> | |
| auto | predict (Tsor const &input_tensor) |
| template<Expression Exp> | |
| auto | operator() (Exp const &ex) const noexcept |
| template<typename Loss , typename Optimizer > | |
| auto | compile (Loss const &l, Optimizer const &o) |
| void | trainable (bool t) |
| void | save_weights (std::string const &file) |
| void | load_weights (std::string const &file) |
| void | summary (std::string const &file_name=std::string{}) const noexcept |
Public Attributes | |
| output_layer_type | expression_ |
| output layer of the model. More... | |
| input_layer_type | place_holder_ |
Groups an input layer (a place holder) and an output layer (an expression template) into an object.
| Ex | The expression template for the output layer. |
| Ph | The place holder expression for the input layer |
| typedef Ph ceras::model< Ex, Ph >::input_layer_type |
| typedef Ex ceras::model< Ex, Ph >::output_layer_type |
|
inline |
| place_holder | The input layer of the model, a place holder. |
| expression | The output layer of the model, a expression template. |
Example code to generate a model:
|
inline |
Compile the model for training
| l | The loss to minimize. |
| o | The optimizer to do the optimization. |
Example useage:
|
inlinenoexcept |
Returns the input layer of the model, which is a place_holder.
|
inline |
Loads all variables from a file
|
inlinenoexcept |
Generating a new expression by using the current model.
| ex | An expression that represents the input to the model. |
Example code
|
inlinenoexcept |
Returns the output layer of the model.
|
inline |
Making prediction by binding the nput data to the place_holder_ and evaluating expression_.
| input_tensor | The input samples. |
Example to predict
|
inline |
Writes all variables to a file
|
inlinenoexcept |
Print the model summary to console or to a file.
| file_name | The file to save the summary. If empty, the summary will be printed to console. Empty by default. |
|
inline |
| output_layer_type ceras::model< Ex, Ph >::expression_ |
output layer of the model.
| input_layer_type ceras::model< Ex, Ph >::place_holder_ |