OpenNN
Open-source neural networks library
Loading...
Searching...
No Matches
standard_networks.h
Go to the documentation of this file.
1// OpenNN: Open Neural Networks Library
2// www.opennn.net
3//
4// S T A N D A R D N E T W O R K S C L A S S H E A D E R
5//
6// Artificial Intelligence Techniques SL
7// artelnics@artelnics.com
8
9#pragma once
10
11#include "neural_network.h"
12
13namespace opennn
14{
15
18{
19
20public:
21
23 ApproximationNetwork(const Shape& input_shape,
24 const Shape& complexity_dimensions,
25 const Shape& output_shape);
26};
27
30{
31
32public:
33
35 ClassificationNetwork(const Shape& input_shape,
36 const Shape& complexity_dimensions,
37 const Shape& output_shape);
38};
39
42{
43
44public:
45
47 ForecastingNetwork(const Shape& input_shape,
48 const Shape& complexity_dimensions,
49 const Shape& output_shape);
50};
51
54{
55
56public:
57
59 AutoAssociationNetwork(const Shape& input_shape,
60 const Shape& complexity_dimensions,
61 const Shape& output_shape);
62};
63
66{
67
68public:
69
72 const Shape& complexity_dimensions,
73 const Shape& output_shape);
74};
75
78{
79
80public:
81
87 SimpleResNet(const Shape& input_shape,
88 const vector<Index>& blocks_per_stage,
89 const Shape& initial_filters,
90 const Shape& output_shape);
91};
92
94class VGG16 final : public NeuralNetwork
95{
96public:
97
99 VGG16(const Shape& input_shape, const Shape& target_shape);
100
102 VGG16(const filesystem::path&);
103
105 void set(const Shape& input_shape, const Shape& target_shape);
106
107};
108
111{
112
113public:
114
117 const Shape& complexity_dimensions,
118 const Shape& output_shape);
119};
120
122class Transformer final : public NeuralNetwork
123{
124public:
125
127 Transformer(const Index = 0,
128 Index = 0,
129 Index = 0,
130 Index = 0,
131 Index = 0,
132 Index = 0,
133 Index = 0,
134 Index = 0);
135
137 void set(const Index = 0,
138 Index = 0,
139 Index = 0,
140 Index = 0,
141 Index = 0,
142 Index = 0,
143 Index = 0,
144 Index = 0);
145
148
151
154
156 Index get_heads_number() const;
157
159 void set_dropout_rate(const float);
160};
161
162}
163
164// OpenNN: Open Neural Networks Library.
165// Copyright(C) 2005-2026 Artificial Intelligence Techniques, SL.
166// Licensed under the GNU Lesser General Public License v2.1 or later.
ApproximationNetwork(const Shape &input_shape, const Shape &complexity_dimensions, const Shape &output_shape)
Builds an approximation network with the given input, complexity and output shapes.
AutoAssociationNetwork(const Shape &input_shape, const Shape &complexity_dimensions, const Shape &output_shape)
Builds an auto-association network with the given input, complexity and output shapes.
ClassificationNetwork(const Shape &input_shape, const Shape &complexity_dimensions, const Shape &output_shape)
Builds a classification network with the given input, complexity and output shapes.
ForecastingNetwork(const Shape &input_shape, const Shape &complexity_dimensions, const Shape &output_shape)
Builds a forecasting network with the given input, complexity and output shapes.
ImageClassificationNetwork(const Shape &input_shape, const Shape &complexity_dimensions, const Shape &output_shape)
Builds an image classification network with the given input, complexity and output shapes.
NeuralNetwork()
Constructs an empty neural network.
SimpleResNet(const Shape &input_shape, const vector< Index > &blocks_per_stage, const Shape &initial_filters, const Shape &output_shape)
Builds a residual network with the given input shape, per-stage block counts and output shape.
TextClassificationNetwork(const Shape &input_shape, const Shape &complexity_dimensions, const Shape &output_shape)
Builds a text classification network with the given input, complexity and output shapes.
Index get_heads_number() const
Returns the number of attention heads per block.
Index get_decoder_sequence_length() const
Returns the configured length of the decoder sequence.
void set_dropout_rate(const float)
Sets the dropout rate applied across the Transformer layers.
Transformer(const Index=0, Index=0, Index=0, Index=0, Index=0, Index=0, Index=0, Index=0)
Builds a Transformer with input/decoder sequence lengths, vocabularies, embedding,...
Index get_embedding_dimension() const
Returns the embedding dimension used by the Transformer.
void set(const Index=0, Index=0, Index=0, Index=0, Index=0, Index=0, Index=0, Index=0)
Reconfigures the Transformer with the supplied architecture parameters.
Index get_input_sequence_length() const
Returns the configured length of the encoder input sequence.
VGG16(const Shape &input_shape, const Shape &target_shape)
Builds a VGG-16 network with the given input and target shapes.
void set(const Shape &input_shape, const Shape &target_shape)
Reconfigures the VGG-16 network with the given input and target shapes.
VGG16(const filesystem::path &)
Builds a VGG-16 network by loading it from the given file path.
Definition adaptive_moment_estimation.h:14
Fixed-capacity small-vector describing tensor dimensions (rank up to MaxRank).
Definition tensor_utilities.h:42