#include <neuron.h>
List of all members.
Static Public Member Functions |
static float | Sigmoid (float activation) |
Protected Member Functions |
void | Init () |
Detailed Description
Definition at line 24 of file neuron.h.
Member Enumeration Documentation
- Enumerator:
Unknown |
|
Input |
|
Hidden |
|
Output |
|
Definition at line 27 of file neuron.h.
Constructor & Destructor Documentation
tesseract::Neuron::Neuron |
( |
| ) |
|
tesseract::Neuron::~Neuron |
( |
| ) |
|
Member Function Documentation
void tesseract::Neuron::AddFromConnection |
( |
Neuron * |
neuron_vec, |
|
|
float * |
wts_offset, |
|
|
int |
from_cnt |
|
) |
| |
Definition at line 74 of file neuron.cpp.
{
for (int in = 0; in < from_cnt; in++) {
}
}
float tesseract::Neuron::bias |
( |
| ) |
const |
|
inline |
void tesseract::Neuron::Clear |
( |
| ) |
|
|
inline |
Neuron* tesseract::Neuron::fan_in |
( |
int |
idx | ) |
const |
|
inline |
int tesseract::Neuron::fan_in_cnt |
( |
| ) |
const |
|
inline |
float tesseract::Neuron::fan_in_wts |
( |
int |
idx | ) |
const |
|
inline |
void tesseract::Neuron::FeedForward |
( |
| ) |
|
int tesseract::Neuron::id |
( |
| ) |
const |
|
inline |
void tesseract::Neuron::Init |
( |
| ) |
|
|
protected |
float tesseract::Neuron::output |
( |
| ) |
const |
|
inline |
template<class BuffType >
template bool tesseract::Neuron::ReadBinary |
( |
BuffType * |
input_buff | ) |
|
|
inline |
Definition at line 42 of file neuron.h.
{
float val;
if (input_buff->Read(&val, sizeof(val)) != sizeof(val)) {
return false;
}
} else {
}
if (input_buff->Read(&fan_in_cnt, sizeof(fan_in_cnt)) !=
return false;
}
if (fan_in_cnt !=
fan_in_.size()) {
return false;
}
if (input_buff->Read(&val, sizeof(val)) != sizeof(val)) {
return false;
}
}
return true;
}
void tesseract::Neuron::set_id |
( |
int |
id | ) |
|
|
inline |
void tesseract::Neuron::set_node_type |
( |
NeuronTypes |
type | ) |
|
void tesseract::Neuron::set_output |
( |
float |
out_val | ) |
|
|
inline |
float tesseract::Neuron::Sigmoid |
( |
float |
activation | ) |
|
|
static |
Definition at line 85 of file neuron.cpp.
{
if (activation <= -10.0
f) {
return 0.0f;
}
else if (activation >= 10.0
f) {
return 1.0f;
} else {
return kSigmoidTable[
static_cast<int>(100 * (activation + 10.0))];
}
}
Member Data Documentation
float tesseract::Neuron::activation_ |
|
protected |
float tesseract::Neuron::bias_ |
|
protected |
vector<Neuron *> tesseract::Neuron::fan_in_ |
|
protected |
vector<float *> tesseract::Neuron::fan_in_weights_ |
|
protected |
bool tesseract::Neuron::frwd_dirty_ |
|
protected |
int tesseract::Neuron::id_ |
|
protected |
const float tesseract::Neuron::kSigmoidTable |
|
staticprotected |
float tesseract::Neuron::output_ |
|
protected |
The documentation for this class was generated from the following files:
- /mnt/data/src/tesseract-ocr/neural_networks/runtime/neuron.h
- /mnt/data/src/tesseract-ocr/neural_networks/runtime/neuron.cpp
- /mnt/data/src/tesseract-ocr/neural_networks/runtime/sigmoid_table.cpp