21 for (
int vec = 0; vec < static_cast<int>(
wts_vec_.size()); vec++) {
27 for (
int node_idx = 0; node_idx <
neuron_cnt_; node_idx++) {
57 for (node_idx = 0; node_idx <
in_cnt_; node_idx++, node++) {
58 node->
out = inputs[node_idx] - node->
bias;
62 double activation = -node->
bias;
63 for (
int fan_in_idx = 0; fan_in_idx < node->
fan_in_cnt; fan_in_idx++) {
71 for (node_idx = 0; node_idx <
out_cnt_; node_idx++, node++) {
72 outputs[node_idx] = node->
out;
89 for (
int in = 0; in <
in_cnt_; in++) {
94 for (
int in = 0; in <
in_cnt_; in++) {
128 for (
int node_idx = 0; node_idx <
neuron_cnt_; node_idx++) {
154 for (
int fan_in = 0; fan_in < node->
fan_in_cnt; fan_in++) {
158 if (
id >= node_idx) {
216 if (net_obj ==
NULL) {
237 for (node_idx = 0; node_idx <
in_cnt_; node_idx++, node++) {
238 node->
out = inputs[node_idx] - node->
bias;
243 for (;node_idx < hidden_node_cnt; node_idx++, node++) {
244 double activation = -node->
bias;
245 for (
int fan_in_idx = 0; fan_in_idx < node->
fan_in_cnt; fan_in_idx++) {
254 double activation = -node->
bias;
255 for (
int fan_in_idx = 0; fan_in_idx < node->
fan_in_cnt; fan_in_idx++) {
269 if (output_id < 0 || output_id >=
out_cnt_) {
284 (*output) = outputs[output_id];
void AddFromConnection(Neuron *neuron_vec, float *wts_offset, int from_cnt)
static NeuralNet * FromInputBuffer(InputFileBuffer *ib)
static const int kWgtChunkSize
vector< float > inputs_min_
float * AllocWgt(int wgt_cnt)
float fan_in_wts(int idx) const
void set_output(float out_val)
bool ReadBinary(ReadBuffType *input_buff)
bool FastFeedForward(const Type *inputs, Type *outputs)
bool FastGetNetOutput(const Type *inputs, int output_id, Type *output)
bool GetNetOutput(const Type *inputs, int output_id, Type *output)
vector< float > inputs_mean_
bool FeedForward(const Type *inputs, Type *outputs)
vector< float > inputs_std_dev_
Neuron * fan_in(int idx) const
vector< Node > fast_nodes_
vector< float > inputs_max_
static float Sigmoid(float activation)
vector< vector< float > * > wts_vec_
bool SetConnection(int from, int to)
static NeuralNet * FromFile(const string file_name)