本文整理汇总了C++中NeuralNetwork::get_output方法的典型用法代码示例。如果您正苦于以下问题:C++ NeuralNetwork::get_output方法的具体用法?C++ NeuralNetwork::get_output怎么用?C++ NeuralNetwork::get_output使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NeuralNetwork
的用法示例。
在下文中一共展示了NeuralNetwork::get_output方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main (int argc, char * const argv[]) {
PopulationEvolver ev(2, 1, evaluate_fitness_xor, 150, 50, 12, 0.04, false);
ev.evolve(1000);
ev.get_population_fitness(0);
cout << "Best fitness = " << ev.population_[0]->fitness_ << endl;
for (int i = 0; i < ev.population_.size(); i++) {
stringstream filename;
filename << "networks/network" << i << ".gv";
ofstream file;
file.open(filename.str().c_str());
file << ev.population_[i]->save();
file.close();
}
return 0;
NeuralNetwork* net = Phenotype::get_network(ev.population_[0]);
while (true) {
vector<double> input(2);
cout << "x0 = ";
cin >> input[0];
cout << "x1 = ";
cin >> input[1];
cout << "y = " << net->get_output(input)[0] << endl;
cout << "------" << endl;
}
return 0;
}
示例2: operator
int operator() (GameState& game_state, PlayerState& player_state, int minimum_money) {
vector<double> input;
input.push_back(Hand_EVAL_N(player_state.cards(),StdDeck_numCards(player_state.cards())));
return min((int)(player_state.get_money()*network_->get_output(input)[0]), minimum_money);
}