459 changes: 229 additions & 230 deletions src/evaluate.c

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions src/network.c
Expand Up @@ -33,7 +33,7 @@
PKNetwork PKNN;

static char *PKWeights[] = {
#include "weights/pknet_224x32x1.net"
#include "weights/pknet_224x32x2.net"
""
};

Expand Down Expand Up @@ -113,7 +113,8 @@ int fullyComputePKNetwork(Thread *thread) {
outputNeurons[i] += layer1Neurons[j] * PKNN.layer1Weights[i][j];
}

return MakeScore((int) outputNeurons[0], 0);
assert(PKNETWORK_OUTPUTS == PHASE_NB);
return MakeScore((int) outputNeurons[MG], (int) outputNeurons[EG]);
}

int partiallyComputePKNetwork(Thread *thread) {
Expand All @@ -130,7 +131,8 @@ int partiallyComputePKNetwork(Thread *thread) {
outputNeurons[i] += layer1Neurons[j] * PKNN.layer1Weights[i][j];
}

return MakeScore((int) outputNeurons[0], 0);
assert(PKNETWORK_OUTPUTS == PHASE_NB);
return MakeScore((int) outputNeurons[MG], (int) outputNeurons[EG]);
}


Expand Down
4 changes: 2 additions & 2 deletions src/network.h
Expand Up @@ -25,13 +25,13 @@

#define PKNETWORK_INPUTS (224)
#define PKNETWORK_LAYER1 ( 32)
#define PKNETWORK_OUTPUTS ( 1)
#define PKNETWORK_OUTPUTS ( 2)

typedef struct PKNetwork {

// PKNetworks are of the form [Input, Hidden Layer 1, Output Layer]
// Our current Network is [224x32, 32x1]. The Network is trained to
// output a Score in CentiPawns for the Midgame only.
// output a Score in CentiPawns for the Midgame and Endgame

ALIGN64 float inputWeights[PKNETWORK_LAYER1][PKNETWORK_INPUTS];
ALIGN64 float inputBiases[PKNETWORK_LAYER1];
Expand Down
2 changes: 1 addition & 1 deletion src/uci.h
Expand Up @@ -22,7 +22,7 @@

#include "types.h"

#define VERSION_ID "12.64"
#define VERSION_ID "12.65"

#if defined(USE_PEXT)
#define ETHEREAL_VERSION VERSION_ID" (PEXT)"
Expand Down
33 changes: 0 additions & 33 deletions src/weights/pknet_224x32x1.net

This file was deleted.

34 changes: 34 additions & 0 deletions src/weights/pknet_224x32x2.net

Large diffs are not rendered by default.