#include <neural_net.h>
Classes | |
struct | Node |
struct | WeightedNode |
Public Member Functions | |
NeuralNet () | |
virtual | ~NeuralNet () |
template<typename Type > | |
bool | FeedForward (const Type *inputs, Type *outputs) |
template<typename Type > | |
bool | GetNetOutput (const Type *inputs, int output_id, Type *output) |
int | in_cnt () const |
int | out_cnt () const |
Static Public Member Functions | |
static NeuralNet * | FromFile (const string file_name) |
static NeuralNet * | FromInputBuffer (InputFileBuffer *ib) |
Protected Member Functions | |
void | Init () |
void | Clear () |
template<class ReadBuffType > | |
bool | ReadBinary (ReadBuffType *input_buff) |
bool | SetConnection (int from, int to) |
bool | CreateFastNet () |
float * | AllocWgt (int wgt_cnt) |
template<typename Type > | |
bool | FastFeedForward (const Type *inputs, Type *outputs) |
template<typename Type > | |
bool | FastGetNetOutput (const Type *inputs, int output_id, Type *output) |
Protected Attributes | |
bool | read_only_ |
int | in_cnt_ |
int | out_cnt_ |
int | neuron_cnt_ |
int | wts_cnt_ |
Neuron * | neurons_ |
int | alloc_wgt_cnt_ |
vector< vector< float > * > | wts_vec_ |
bool | auto_encoder_ |
vector< float > | inputs_max_ |
vector< float > | inputs_min_ |
vector< float > | inputs_mean_ |
vector< float > | inputs_std_dev_ |
vector< Node > | fast_nodes_ |
Static Protected Attributes | |
static const int | kWgtChunkSize = 0x10000 |
static const unsigned int | kNetSignature = 0xFEFEABD0 |
tesseract::NeuralNet::NeuralNet | ( | ) |
tesseract::NeuralNet::~NeuralNet | ( | ) | [virtual] |
float * tesseract::NeuralNet::AllocWgt | ( | int | wgt_cnt | ) | [protected] |
void tesseract::NeuralNet::Clear | ( | ) | [inline, protected] |
bool tesseract::NeuralNet::CreateFastNet | ( | ) | [protected] |
bool tesseract::NeuralNet::FastFeedForward | ( | const Type * | inputs, | |
Type * | outputs | |||
) | [inline, protected] |
bool tesseract::NeuralNet::FastGetNetOutput | ( | const Type * | inputs, | |
int | output_id, | |||
Type * | output | |||
) | [inline, protected] |
bool tesseract::NeuralNet::FeedForward | ( | const Type * | inputs, | |
Type * | outputs | |||
) | [inline] |
NeuralNet * tesseract::NeuralNet::FromFile | ( | const string | file_name | ) | [static] |
NeuralNet * tesseract::NeuralNet::FromInputBuffer | ( | InputFileBuffer * | ib | ) | [static] |
bool tesseract::NeuralNet::GetNetOutput | ( | const Type * | inputs, | |
int | output_id, | |||
Type * | output | |||
) | [inline] |
int tesseract::NeuralNet::in_cnt | ( | ) | const [inline] |
void tesseract::NeuralNet::Init | ( | ) | [protected] |
int tesseract::NeuralNet::out_cnt | ( | ) | const [inline] |
bool tesseract::NeuralNet::ReadBinary | ( | ReadBuffType * | input_buff | ) | [inline, protected] |
bool tesseract::NeuralNet::SetConnection | ( | int | from, | |
int | to | |||
) | [protected] |
int tesseract::NeuralNet::alloc_wgt_cnt_ [protected] |
bool tesseract::NeuralNet::auto_encoder_ [protected] |
vector<Node> tesseract::NeuralNet::fast_nodes_ [protected] |
int tesseract::NeuralNet::in_cnt_ [protected] |
vector<float> tesseract::NeuralNet::inputs_max_ [protected] |
vector<float> tesseract::NeuralNet::inputs_mean_ [protected] |
vector<float> tesseract::NeuralNet::inputs_min_ [protected] |
vector<float> tesseract::NeuralNet::inputs_std_dev_ [protected] |
const unsigned int tesseract::NeuralNet::kNetSignature = 0xFEFEABD0 [static, protected] |
const int tesseract::NeuralNet::kWgtChunkSize = 0x10000 [static, protected] |
int tesseract::NeuralNet::neuron_cnt_ [protected] |
Neuron* tesseract::NeuralNet::neurons_ [protected] |
int tesseract::NeuralNet::out_cnt_ [protected] |
bool tesseract::NeuralNet::read_only_ [protected] |
int tesseract::NeuralNet::wts_cnt_ [protected] |
vector<vector<float> *> tesseract::NeuralNet::wts_vec_ [protected] |