Loading...
Searching...
No Matches
models.h
Go to the documentation of this file.
96 enum class Backbone { Vgg, DarknetTiny, DarknetTinyV3, Darknet53, CSPDarknet53, CSPDarknet53v11 };
169 Index get_input_sequence_length() const { return get_layer("encoder_embedding")->get_input_shape()[0]; }
170 Index get_decoder_sequence_length() const { return get_layer("decoder_embedding")->get_input_shape()[0]; }
ApproximationNetwork(const Shape &, const Shape &, const Shape &, const string &hidden_activation="Tanh")
Autoencoder(const Shape &, const Shape &, const string &, const string &)
static Pretrained from_pretrained(const filesystem::path &)
BertForSequenceClassification(Index sequence_length, Index vocabulary_size, Index hidden_size, Index heads_number, Index intermediate_size, Index layers_number, Index labels_number, Index type_vocabulary_size=2)
BertForSequenceClassification()
void set_dropout_rate(const float)
Bert()
Bert(Index sequence_length, Index vocabulary_size, Index hidden_size, Index heads_number, Index intermediate_size, Index layers_number, Index type_vocabulary_size=2)
ClassificationNetwork(const Shape &, const Shape &, const Shape &, const string &hidden_activation="Tanh")
ForecastingLstmNetwork(const Shape &, const Shape &, const Shape &)
ForecastingNetwork(const Shape &, const Shape &, const Shape &)
ImageClassificationNetwork(const Shape &, const Shape &, const Shape &)
Definition network.h:87
const unique_ptr< Layer > & get_layer(const Index layer_index) const
Definition network.h:221
Network()
Qwen3(Index sequence_length, Index vocabulary_size, Index hidden_size, Index layers_number, Index query_heads, Index key_value_heads, Index head_dimension, Index intermediate_size, float rope_theta=1000000.0f, float rms_epsilon=1.0e-6f)
static unique_ptr< Qwen3 > from_pretrained(Variant, const filesystem::path &, Index sequence_length=32768)
Qwen3()
static unique_ptr< Qwen3 > from_binary(const filesystem::path &weights_path, Index sequence_length, Index vocabulary_size, Index hidden_size, Index layers_number, Index query_heads, Index key_value_heads, Index head_dimension, Index intermediate_size, float rope_theta=1000000.0f, float rms_epsilon=1.0e-6f)
static unique_ptr< ResNet > from_pretrained(const filesystem::path &)
ResNet(const Shape &, const vector< Index > &, const Shape &, const Shape &, bool use_bottleneck=false)
void set_tokenizer(unique_ptr< TokenizerOperator >)
static constexpr Index default_hidden_neurons
Definition models.h:138
const TokenizerOperator * get_tokenizer() const
Prediction classify(string_view)
static constexpr Index default_heads_number
Definition models.h:137
MatrixR calculate_text_outputs(const Tensor< string, 1 > &)
TextClassificationNetwork(const Shape &, const Shape &, const Shape &, PoolingMethod pooling_method=PoolingMethod::AveragePooling)
static constexpr Index default_embedding_dimension
Definition models.h:136
void load_pretrained(const filesystem::path &data_directory)
TextGenerationNetwork(const filesystem::path &)
void set_vocabulary(const vector< string > &)
void set_dropout_rate(const float)
TextGenerationNetwork()
void set_attention_sdpa_auto(bool new_sdpa_auto)
const TokenizerOperator * get_tokenizer() const
void set_tokenizer(unique_ptr< TokenizerOperator >)
TextGenerationNetwork(Index, Index, Index, Index, Index, Index, bool pre_normalization=false, bool scale_embedding=true, bool learned_positional=false, const string &feed_forward_activation="ReLU")
Index get_sequence_length() const
Definition models.h:205
Definition tokenizer_operator.h:35
const TokenizerOperator * get_target_tokenizer() const
void set_target_vocabulary(const vector< string > &)
Transformer(const filesystem::path &)
Transformer(Index, Index, Index, Index, Index, Index, Index, Index)
Index get_decoder_sequence_length() const
Definition models.h:170
void set_dropout_rate(const float)
void set_input_vocabulary(const vector< string > &)
const vector< string > & get_target_vocabulary() const
Transformer()
const TokenizerOperator * get_input_tokenizer() const
Index get_input_sequence_length() const
Definition models.h:169
void set_attention_sdpa_min_sequence_length(Index)
const vector< string > & get_input_vocabulary() const
Index load_pretrained_backbone(const filesystem::path &)
Yolo(const Shape &, Index, const vector< array< float, 2 > > &, Index grid_size=13, Backbone backbone=Backbone::Vgg, ClassActivation class_activation=ClassActivation::Softmax, HeadStyle head_style=HeadStyle::Single, BodyActivation body_activation=BodyActivation::ReLU, bool use_sppf=false, Index reg_max=1, ModelSize model_size=ModelSize::l)
Definition configuration.h:10
Index load_darknet_backbone(Network &, const filesystem::path &, Index)
Index load_yolov8s_onnx(Network &, const filesystem::path &onnx_path, Index n_classes)
Index load_darknet_backbone_v11(Network &, const filesystem::path &)
Eigen::Matrix< float, Eigen::Dynamic, Eigen::Dynamic, Layout > MatrixR
Definition opennn_types.h:331
Definition models.h:289
unique_ptr< BertForSequenceClassification > model
Definition models.h:290
Index sequence_length
Definition models.h:292
filesystem::path vocabulary_path
Definition models.h:291
Definition tensor_types.h:172
Definition models.h:131