CorTeX Core ABI 7
ToolTech Software · C++ library reference
Loading...
Searching...
No Matches
ctxInlineFuncs.h
Go to the documentation of this file.
1//*****************************************************************************
2// File : ctxInlineFuncs.h
3// Description : Inline functions for Cpp exec
4// Author : Anders Modén
5// Product : CorTeX 2.0.1
6//
7// Copyright © 2015- Anders Modén, Sweden
8//
9// NOTE: CorTeX is a software development kit (SDK)
10// for neural networks and genetic programming.
11// Licensed by Anders Modén.
12//
13//
14// Revision History...
15//
16// Who Date Description
17//
18// AMO 150708 Created file (1.0.0)
19//
20//******************************************************************************
21#ifndef __CTX_INLINE_FUNCS_H__
22#define __CTX_INLINE_FUNCS_H__
23
24#include "ctxBase.h"
25
26// ------------------------ Utility inlines for Cpp ----------------------
27
28inline gzVoid ctxNeuronFunc_0(gzFloat *s) // CTX_NEURON_TYPE_PERCEPTRON
29{
30 *s = (*s > 0 ? 1.0f : 0.0f);
31}
32
33inline gzVoid ctxNeuronFunc_6(gzFloat *s)
34{
35 *s = (*s>0 ? *s : 0.0f);
36}
37
38inline gzVoid ctxNeuronFunc_7(gzFloat *s)
39{
40 *s = (*s>0 ? *s : expf(*s) - 1.0f);
41}
42
43inline gzVoid ctxNeuronFunc_8(gzFloat *s)
44{
45 *s = (*s>0 ? SELU_SCALE * *s : SELU_ALPHA_SCALE * (expf(*s) - 1.0f));
46}
47
48#endif //__CTX_INLINE_FUNCS_H__
49
50
#define SELU_ALPHA_SCALE
#define SELU_SCALE
gzVoid ctxNeuronFunc_6(gzFloat *s)
gzVoid ctxNeuronFunc_7(gzFloat *s)
gzVoid ctxNeuronFunc_0(gzFloat *s)
gzVoid ctxNeuronFunc_8(gzFloat *s)