Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Informative Tournament Info #28

Closed
Videodr0me opened this issue Jun 3, 2018 · 4 comments
Closed

Informative Tournament Info #28

Videodr0me opened this issue Jun 3, 2018 · 4 comments
Labels
good first issue Good for newcomers

Comments

@Videodr0me
Copy link
Collaborator

Videodr0me commented Jun 3, 2018

I made the tournament info more readable and included win%, Elo and LOS.

before:

tournamentstatus win 3 3 lose 5 3 draw 8 10

after - obviously not same tournament as above ;-):

tournamentstatus P1: +815 -825 =1213 Win: 49.82% Elo: -1.22 LOS: 40.25% P1-W: +473 -354 =600 P1-B: +342 -471 =613

code change in loop.cc:

void SelfPlayLoop::SendTournament(const TournamentInfo& info) {
  int winp1 = info.results[0][0] + info.results[0][1];
  int loosep1 = info.results[2][0] + info.results[2][1]; 
  int draws = info.results[1][0] + info.results[1][1];
  float perct=-1, elo=99999;
  float los = 99999; 
  if ((winp1+loosep1+draws)>0) perct = (((float)draws) / 2 + winp1) / (winp1 + loosep1 + draws);
  if ((perct < 1) && (perct > 0)) elo = -400 * log(1 / perct - 1) / log(10);
  if ((winp1 + loosep1)>0) los = .5 + .5 * std::erf((winp1 - loosep1) / std::sqrt(2.0*(winp1 + loosep1)));

  std::string res = "tournamentstatus";
  if (info.finished) res += " final";
  res += " P1: +" + std::to_string(winp1) + " -" + std::to_string(loosep1) + " =" + std::to_string(draws);
  if (perct > 0) {
 	  std::ostringstream oss;
	  oss << std::fixed<<std::setw(5) << std::setprecision(2) << (perct * 100) <<"%";
	  res += " Win: " + oss.str();
  }
  if (elo < 99998) {
	  std::ostringstream oss;
	  oss << std::fixed<< std::setw(5)<<std::setprecision(2) << (elo);
	  res += " Elo: " + oss.str();
  }
  if (los < 99998) {
  std::ostringstream oss;
  oss << std::fixed << std::setw(5) << std::setprecision(2) << (los * 100) << "%";
  res += " LOS: " + oss.str();
  }
  res += " P1-W: +" + std::to_string(info.results[0][0]) + " -" + std::to_string(info.results[2][0]) + " =" + std::to_string(info.results[1][0]);
  res += " P1-B: +" + std::to_string(info.results[0][1]) + " -" + std::to_string(info.results[2][1]) + " =" + std::to_string(info.results[1][1]);
  SendResponse(res);
}
@dubslow
Copy link
Member

dubslow commented Jun 6, 2018

Any reason this isn't a Pull Request?

@Videodr0me
Copy link
Collaborator Author

Videodr0me commented Jun 23, 2018

The main reason is that I started my MCTS test project just when the repo was moving so i did not fork but just started a new repository. Also at the time i thought that public release of lc0 was imminent and wanted to wait until things quieted down in the search code - not to introduce new bugs just before launch. The code should still work, just feel free to cut and paste it into loop.cc. Also @dublow, as you currently work on the verbose move stats info - in my repo I added a line about root stats, as i found that informative when debugging. If you like you can just include that too (or a flavour of it, as i have more stats than master lc0).

@mooskagh mooskagh added the good first issue Good for newcomers label Jul 10, 2018
@mooskagh
Copy link
Member

Being implemented in #254

@mooskagh
Copy link
Member

I believe that's already implemented.

benblack769 pushed a commit to benblack769/lc0-stockfish-hybrid that referenced this issue Jan 16, 2022
use meson 0.55.3 on appveyor since 0.56.0 is broken (LeelaChessZero#1457)
almaudoh pushed a commit to almaudoh/lc0 that referenced this issue Jan 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants