bug-gnubg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Bug-gnubg] (no subject)


From: Øystein O Johansen
Subject: RE: [Bug-gnubg] (no subject)
Date: Thu, 1 Aug 2002 13:32:13 +0200

> If you train exclusively on these there is the danger that
> it might not be good at playing the "ordinary" crashed
> position well. Or will the weights it learns from these
> positions be suitable for all cases?

Yes, this is what I'm worried about as well.

If you're only searching for misevaluated positions from the
crashed net, you can use the 'database generate' command,
export the database ( database export <filename> ), and then
use this little program to sieve out the right positions:

---- 8< ---- sieve.c ---- 8< ----

#include <stdio.h>
#include "eval.h"
#include "positionid.h"

#define MAX_POSITIONS 2700

int main(int argc, char *argv[]){

  char *asz[6] = { "over", "bearoff2", "bearoff1", "race", "crashed",
       "contact" };
  char posID[15];
  int anBoard[2][25];
  int anCounter[6] = { 0, 0, 0, 0, 0, 0 };
  int i, j, dummy;
  positionclass pc;
  FILE *pf;

  pf = fopen( argv[1], "r" );

  for (i = 0; i < MAX_POSITIONS; i++) {
    fscanf( pf, "%s", posID);

    for (j = 0; j < 7 ; j++)
       fscanf( pf, "%d", &dummy);

    PositionFromID ( anBoard, posID );
    pc = ClassifyPosition( anBoard );
    anCounter[pc]++;
    printf("%s : %s\n", posID, asz[pc]);
  }

  fclose ( pf );

  printf("\n       Statistics\n------------------------\n");

  for (i = 0 ; i < 6 ; i++)
    printf("%10s : %5d\n", asz[i], anCounter[i]);

  return 0;
}

---- 8< ---- sieve.c ---- 8< ----

Example usage: sieve databasefile.txt | grep crashed

-Øystein



-------------------------------------------------------------------
The information contained in this message may be CONFIDENTIAL and is
intended for the addressee only. Any unauthorised use, dissemination of the
information or copying of this message is prohibited. If you are not the
addressee, please notify the sender immediately by return e-mail and delete
this message.
Thank you.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]