Comments (13)
Fixed in 401d25b
from nnue-pytorch.
Ah, we didn't need that with the existing layers. Should be fixed in 36de78f
from nnue-pytorch.
hmm, I'd be curious to try some different sizes, any chance for a fix?
from nnue-pytorch.
Yes, I will take a look. Until it's fixed, if you want to, you can compile nodchip with the different arch, and print out the hash to workaround the problem - that's how I got the original hash :).
from nnue-pytorch.
I've started an optimization, will serialize later (couldn't figure out where to print it, honestly).
from nnue-pytorch.
Layer stack or feature transformer hash: https://github.com/official-stockfish/Stockfish/blob/76daa88cf878b12a03755dc0550b3fa8e4d19cb1/src/nnue/evaluate_nnue.cpp#L67
Combined hash: https://github.com/official-stockfish/Stockfish/blob/76daa88cf878b12a03755dc0550b3fa8e4d19cb1/src/nnue/evaluate_nnue.cpp#L100
Either print it or remove the checks.
from nnue-pytorch.
Note that you will need to add a layer into the layers list in serialize.py, but otherwise it shouldn't need any changes.
from nnue-pytorch.
Thanks! For changes sizes nothing will be needed right?
from nnue-pytorch.
No changes required if just adjusting size :).
from nnue-pytorch.
I'm not getting it to work, must make a trivial mistake somewhere. I have this change to the trainer:
diff --git a/model.py b/model.py
index fb34284..c1d4724 100644
--- a/model.py
+++ b/model.py
@@ -6,9 +6,9 @@ import torch.nn.functional as F
import pytorch_lightning as pl
# 3 layer fully connected network
-L1 = 256
-L2 = 32
-L3 = 32
+L1 = 512
+L2 = 16
+L3 = 16
class NNUE(pl.LightningModule):
"""
and this to the player:
diff --git a/src/evaluate.h b/src/evaluate.h
index 8beca2d0a..92cf96df0 100644
--- a/src/evaluate.h
+++ b/src/evaluate.h
@@ -36,7 +36,7 @@ namespace Eval {
// The default net name MUST follow the format nn-[SHA256 first 12 digits].nnue
// for the build process (profile-build and fishtest) to work. Do not change the
// name of the macro, as it is used in the Makefile.
- #define EvalFileDefaultName "nn-62ef826d1a6d.nnue"
+ #define EvalFileDefaultName "nn-f73eccf09644.nnue"
namespace NNUE {
diff --git a/src/nnue/architectures/halfkp_256x2-32-32.h b/src/nnue/architectures/halfkp_256x2-32-32.h
index a0fe2e0ad..410465139 100644
--- a/src/nnue/architectures/halfkp_256x2-32-32.h
+++ b/src/nnue/architectures/halfkp_256x2-32-32.h
@@ -35,14 +35,14 @@ using RawFeatures = Features::FeatureSet<
Features::HalfKP<Features::Side::kFriend>>;
// Number of input feature dimensions after conversion
-constexpr IndexType kTransformedFeatureDimensions = 256;
+constexpr IndexType kTransformedFeatureDimensions = 512;
namespace Layers {
// Define network structure
using InputLayer = InputSlice<kTransformedFeatureDimensions * 2>;
-using HiddenLayer1 = ClippedReLU<AffineTransform<InputLayer, 32>>;
-using HiddenLayer2 = ClippedReLU<AffineTransform<HiddenLayer1, 32>>;
+using HiddenLayer1 = ClippedReLU<AffineTransform<InputLayer, 16>>;
+using HiddenLayer2 = ClippedReLU<AffineTransform<HiddenLayer1, 16>>;
using OutputLayer = AffineTransform<HiddenLayer2, 1>;
} // namespace Layers
but the network fails to load.
A sample checkpoint would be https://drive.google.com/file/d/1iTnABec1Ok771Jo1_kyVEvbvdTYowhtk/view?usp=sharing
Any idea what I might be doing wrong?
from nnue-pytorch.
this could be because we're not padding the input dimensions to a multiple of 32 on serialization.
For example if we had a 4->4 affine transform it would naively get serialized like
01 02 03 04
05 06 07 08
09 10 11 12
13 14 15 16
but what needs to be done is
01 02 03 04 00 00 00 00 ... to 32 bytes
05 06 07 08 00 00 00 00 ... to 32 bytes
09 10 11 12 00 00 00 00 ... to 32 bytes
13 14 15 16 00 00 00 00 ... to 32 bytes
The player probably fails because it expects more data.
from nnue-pytorch.
good analysis! That is likely going to be the reason.
from nnue-pytorch.
@glinscott works well now... thanks!
from nnue-pytorch.
Related Issues (20)
- serialize with --features=HalfKP no longer works
- Wrong input size in SFNNv5 architecture diagram
- Pytorch Lightning Version
- Illegal instruction HOT 2
- serialize.py not working HOT 9
- Changing epoch size and resulting number of epochs when running train.py HOT 3
- Error with visualize.py HOT 2
- Loss Curves HOT 6
- Testing trained model HOT 7
- Is it possible to convert a NNUE file (weights and biases) to emulate an older version? HOT 3
- Butterfly Effect Can Cause The Wrong NNUE Evaluation HOT 7
- Stockfish 15.1 NNUE Eval Blunder Due To The Butterfly Effect
- train.py stops without errors HOT 1
- No .nnue files found HOT 4
- Network Testing Issue HOT 2
- pytorch alphazero? HOT 1
- ftperm.py crashes with 'FenBatchProvider' object has no attribute 'stream'
- Visualizing chess position embeddings HOT 7
- Quantization losses in the L1 biases of L1 3072
- Getting started -- .binpack files missing? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nnue-pytorch.