ViT wavefunction failing on small nearest-neighbor Heisenberg model #2107
|
Using the tutorial in the netket documentation for setting up a vision transformer wavefunction, I've found that the wavefunction fails rather dramatically for small system sizes (L=4 and L=6), specifically for the unfrustrated model (J2 = 0). At least on my end, I've found that this is reproducible using the exact code from the tutorial, with the only modifications coming from changing parameters of the model. For L=4 or 6 and J2=0, the energy as a function of optimization step has large fluctuations and frequently leads to NaN values. I've simplified down the network (for example, one layer with d=h=4) and this behavior persists. Increasing the diag_shift of the SR and lowering the learning rate by an order of magnitude does reduce the frequency of the NaN blowups, but the problem persists. I would like to understand why the variational state seems to be crashing out in this seemingly simple limit - any suggestions? Exploiting the sign rule would make this problem easier, but I wouldn't expect it to be necessary in this case. |
Replies: 3 comments 5 replies
|
Can you provide the exact hyper parameters for the network (model dimension, heads, features, depth...) and optimizer (learning rate, sr? diagonal shift...) and maybe show a few plots of the training for a given system size? sharing the full script would be useful |



Hi, the main problem of your setup is the choice d_model=n_heads=4. Using instead:
vit_module = ViT( num_layers=1, d_model=16, n_heads=4, patch_size=2, transl_invariant=True )you can already get something reasonable with a simulation of few seconds: