Comments (3)
A small batch size makes the estimate of the gradients and Fisher information matrix noisier and hence NaNs more likely.
You are comparing calculations using a simple cubic cell and a body-centred cubic cell. It is not surprising that they give very different energies for small system sizes.
from ferminet.
Hi James,
Thanks for the reply. Actually I also tried the following:
import sys
from absl import logging
from ferminet.utils import system
from ferminet import base_config
from ferminet import train
from ferminet.pbc import envelopes
import numpy as np
import jax.numpy as jnp
from jax.config import config
def _sc_lattice_vecs(rs: float, nelec: int) -> np.ndarray:
"""Returns simple cubic lattice vectors with Wigner-Seitz radius rs."""
volume = (4 / 3) * np.pi * (rs**3) * nelec
length = volume**(1 / 3)
return length * np.eye(3)
# Optional, for also printing training progress to STDOUT.
# If running a script, you can also just use the --alsologtostderr flag.
logging.get_absl_handler().python_handler.stream = sys.stdout
logging.set_verbosity(logging.INFO)
# Get default options.
cfg = base_config.default()
cfg.system.electrons = (7, 7)
# A ghost atom at the origin defines one-electron coordinate system.
# Element 'X' is a dummy nucleus with zero charge
cfg.system.molecule = [system.Atom("X", (0., 0., 0.))]
# Pretraining is not currently implemented for systems in PBC
cfg.pretrain.method = None
lattice = _sc_lattice_vecs(1.0, sum(cfg.system.electrons))
kpoints = envelopes.make_kpoints(lattice, cfg.system.electrons)
cfg.system.make_local_energy_fn = "ferminet.pbc.hamiltonian.local_energy"
cfg.system.make_local_energy_kwargs = {"lattice": lattice, "heg": True}
cfg.network.make_feature_layer_fn = (
"ferminet.pbc.feature_layer.make_pbc_feature_layer")
cfg.network.make_feature_layer_kwargs = {
"lattice": lattice,
"include_r_ae": False
}
cfg.network.make_envelope_fn = (
"ferminet.pbc.envelopes.make_multiwave_envelope")
cfg.network.make_envelope_kwargs = {"kpoints": kpoints}
cfg.network.full_det = False
train.train(cfg)
If I understand correctly, this should use the default 4096 examples and have the same 14 electrons simple cubic setup. However, it also reports NaN after 100ish steps optimization. May I know whether one should use more samples?
In addition, may I know whether it is also proper to use
cfg.network.network_type='psiformer'
in the above code. It seems that the optimization then reports energy of 7.173, which is also quite lower than the number reported in the paper (around 8.0). Is this setup correct?
from ferminet.
- More likely caused by the initalisation. The code defaults to initialising based upon a Gaussian centred at the origin; the HEG calculations used a uniform initialisation over the unit cell (easily implemented but not included in the pull request implementing the HEG Hamiltonian.
- Yes, though note the defaults do not match exactly the network configurations used in the ICLR paper.
- What do you mean by 'reports an energy of'? After how many iterations? What is the variance? Did you do any analysis to calculate the expected energy from an inference run? It is not possible to say whether your calculations are correct from the information provided.
from ferminet.
Related Issues (20)
- Question about exact_cusp function HOT 1
- Installation Error HOT 7
- How does training time scale w.r.t. model size? HOT 1
- Jax install - issue with correct version number HOT 1
- AttributeError: module 'jax.core' has no attribute 'extract_call_jaxpr' HOT 1
- Jax error running on A100 GPU (everything is okay on CPU) HOT 2
- unable to setup HOT 1
- The proper way to cite FermiNet repo HOT 1
- Ground State Energies HOT 2
- Question about pbc ewald part. HOT 2
- nan when training with 'adam' HOT 1
- Question About load Checkpoint HOT 1
- Evaluating logprob using batch_network in train HOT 1
- Issue on running pytest HOT 5
- Extension of PBC code to 1D HOT 7
- Something went wrong in RepeatedDenseBlock.update_curvature_matrix_estimate HOT 2
- Different results obtained from the paper for ch3nh2 HOT 2
- kfac_jax error when running H2 example script HOT 2
- Upstream breaking change in `kfac-jax`
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 ferminet.