AIfES 2  2.0.0
ailayer_input.h File Reference

Base layer implementation of the Input layer. More...

Go to the source code of this file.

Data Structures

struct  ailayer_input
 General Input layer structure. More...
 

Typedefs

typedef struct ailayer_input ailayer_input_t
 

Functions

ailayer_tailayer_input (ailayer_input_t *layer)
 Initialize the given Input layer. More...
 
void ailayer_input_forward (ailayer_t *self)
 Calculate the forward pass for given Input layer. More...
 
void ailayer_input_backward (ailayer_t *self)
 Calculate the backward pass for the given Input layer. More...
 
void ailayer_input_calc_result_shape (ailayer_t *self)
 Calculate the shape of the result tensor. More...
 
void ailayer_input_print_specs (const ailayer_t *self, int(*print)(const char *format,...))
 Print the layer specification. More...
 

Variables

const aicore_layertype_tailayer_input_type
 Input layer type. More...
 

Detailed Description

Base layer implementation of the Input layer.

Version
2.0alpha

AIfES is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

This is an "abstract" data-type independent implementation. To use the layer use one of the provided implementations for a specific hardware and data-type (for example from ailayer_input_default.h) or set the required math functions on your own.

The Input layer is the start layer for every AIfES 2 model.

Function Documentation

◆ ailayer_input()

Initialize the given Input layer.

This function represents the "constructor" of the abstract Input layer. It initializes the layer structure and connects it to the previous layer.
This function is not intended to call it directly. Instead use one of the data type specific implementations (like for example ailayer_input_f32_default()).

Parameters
*layerThe layer to initialize.
Returns
Pointer to the (successfully) initialized general layer structure (ailayer_input.base).

◆ ailayer_input_backward()

void ailayer_input_backward ( ailayer_t self)

Calculate the backward pass for the given Input layer.

Implementation of ailayer.backward.

The standard layer interface demands a backward pass function for the net scheduler, but theres no sense in 'calculating' an input layer, so this function returns without doing something.

Parameters
*selfLayer to 'calculate' the backward pass for.

◆ ailayer_input_calc_result_shape()

void ailayer_input_calc_result_shape ( ailayer_t self)

Calculate the shape of the result tensor.

Implementation of ailayer.calc_result_shape

As the result shape is given by the configured ailayer_input.input_shape parameter, this function returns without doing anything.

Parameters
*selfLayer to calculate the resulting shape for.

◆ ailayer_input_forward()

void ailayer_input_forward ( ailayer_t self)

Calculate the forward pass for given Input layer.

Implementation of ailayer.forward.

The standard layer interface demands a forward pass function for the net scheduler, but theres no sense in 'calculating' an input layer, so this function returns without doing something.

Parameters
*selfLayer to 'calculate' the forward pass for.

◆ ailayer_input_print_specs()

void ailayer_input_print_specs ( const ailayer_t self,
int(*)(const char *format,...)  print 
)

Print the layer specification.

Parameters
*selfThe layer to print the specification for
*printPointer to the print function to use

Variable Documentation

◆ ailayer_input_type

const aicore_layertype_t* ailayer_input_type
extern

Input layer type.

Defines the type of the layer (for example for type checks and debug prints). See aicore_layertype for more information about the layer type.