30 for (
int vec = 0; vec < static_cast<int>(
wts_vec_.size()); vec++) {
36 for (
int node_idx = 0; node_idx <
neuron_cnt_; node_idx++) {
66 for (node_idx = 0; node_idx <
in_cnt_; node_idx++, node++) {
67 node->
out = inputs[node_idx] - node->
bias;
71 double activation = -node->
bias;
72 for (
int fan_in_idx = 0; fan_in_idx < node->
fan_in_cnt; fan_in_idx++) {
80 for (node_idx = 0; node_idx <
out_cnt_; node_idx++, node++) {
81 outputs[node_idx] = node->
out;
98 for (
int in = 0; in <
in_cnt_; in++) {
103 for (
int in = 0; in <
in_cnt_; in++) {
137 for (
int node_idx = 0; node_idx <
neuron_cnt_; node_idx++) {
160 for (
int fan_in = 0; fan_in < node->
fan_in_cnt; fan_in++) {
164 if (
id >= node_idx) {
240 for (node_idx = 0; node_idx <
in_cnt_; node_idx++, node++) {
241 node->
out = inputs[node_idx] - node->
bias;
246 for (;node_idx < hidden_node_cnt; node_idx++, node++) {
247 double activation = -node->
bias;
248 for (
int fan_in_idx = 0; fan_in_idx < node->
fan_in_cnt; fan_in_idx++) {
257 double activation = -node->
bias;
258 for (
int fan_in_idx = 0; fan_in_idx < node->
fan_in_cnt; fan_in_idx++) {
272 if (output_id < 0 || output_id >=
out_cnt_) {
287 (*output) = outputs[output_id];
bool SetConnection(int from, int to)
static NeuralNet * FromFile(const string file_name)
static NeuralNet * FromInputBuffer(InputFileBuffer *ib)
bool FeedForward(const Type *inputs, Type *outputs)
Neuron * fan_in(int idx) const
vector< float > inputs_max_
bool FastFeedForward(const Type *inputs, Type *outputs)
float fan_in_wts(int idx) const
void AddFromConnection(Neuron *neuron_vec, float *wts_offset, int from_cnt)
bool FastGetNetOutput(const Type *inputs, int output_id, Type *output)
vector< vector< float > * > wts_vec_
static const int kWgtChunkSize
bool GetNetOutput(const Type *inputs, int output_id, Type *output)
vector< float > inputs_min_
bool ReadBinary(ReadBuffType *input_buff)
vector< float > inputs_std_dev_
void set_output(float out_val)
static float Sigmoid(float activation)
vector< float > inputs_mean_
float * AllocWgt(int wgt_cnt)
vector< Node > fast_nodes_