This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // based on wyrand (wyhash), 2^64 period, sufficiently good quality | |
| #include <cstdint> | |
| #include <cstdlib> | |
| using namespace std; | |
| static const double NORM_DOUBLE = 1.0 / (1ULL << 53); | |
| static const float NORM_FLOAT = 1.0 / (1ULL << 24); | |
| class Random { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 347 minishogi 8-ply openings, somewhat reasonable, probably not really balanced | |
| // but can be used for testing with variety of openings | |
| 1rg1k/2bsp/5/PSB2/K1GR1 b - 9 | |
| r2g1/1sb1p/4k/PSB2/KG1R1 b - 9 | |
| 2r1k/Bsbgp/5/PS3/KGR2 b - 9 | |
| 1r1gk/1sb1p/5/PSB2/KG2R b - 9 | |
| r3k/1s1gp/1B3/PG1Sb/K2R1 b - 9 | |
| r3k/1s1gp/5/PSB1b/KG1R1 b - 9 | |
| 1rg1k/2bsp/5/PSB2/KG1R1 b - 9 | |
| 2r1k/1sbgp/5/PG1S1/K2BR b - 9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // How to copy bunch of floats into codingame, a bit lowered precision, assuming c++ code | |
| // Not the smartest or best approach, but good enough for my needs | |
| // locally in C++ code | |
| void printWeightsToFile(const vector<float> & nn_weights, string name) { | |
| float m = 0; | |
| float sum = 0; | |
| for (auto i : nn_weights) { | |
| int32_t s = (int32_t)round((2048*(i+12))); | |
| float x = (s/2048.0)-12; |