Skip to content
Snippets Groups Projects
  1. Apr 25, 2022
  2. Apr 19, 2022
  3. Apr 13, 2022
  4. Apr 12, 2022
  5. Apr 11, 2022
    • Clemens Giuliani's avatar
      Fix #1153 (#1155) · a082ba17
      Clemens Giuliani authored
      * fix unwanted promotion in dense and pytree
      
      fixes unwanted promotion to double precision of the oks when working with single precision params
      a082ba17
    • Filippo Vicentini's avatar
      Actually call _log_additional_data (#1159) · 48b4ec08
      Filippo Vicentini authored
      I think this change got lost when @femtobit rebased my driver implementation for TDVP so.. here's it.
      This actually makes the TDVP solver log the times (before, it was not working).
      
      It's actually useful to log other stuff sometimes.
      We should actually document it somewhere, but I'll leave the documentation effort for later.
      48b4ec08
    • Filippo Vicentini's avatar
      fix #1157 (#1158) · b8b9507a
      Filippo Vicentini authored
      Add a shape check
      fix #1157
      b8b9507a
  6. Apr 08, 2022
  7. Apr 06, 2022
  8. Apr 05, 2022
  9. Apr 01, 2022
    • Attila Szabó's avatar
      Handling negative reals correctly in `logsumexp` (#1134) · 4aef9b49
      Attila Szabó authored
      Closes #1133, the issue of GCNNs described at [RFC] [bug] logsumexp in GCNNs.
      
      Adds `nk.nn.logsumexp_cplx`, which wraps the JAX logsumexp but always returns complex results, handles the logs of negative reals correctly within complex arithmetics, without promoting all real inputs to complex (which might be a memory bottleneck for some applications).
      
      Only thing to settle is whether the new ensure_cplx flag should default to true or false. True is a minimal breaking change (hitherto real outputs will come with identically zero imaginary parts), but it removes a silent error we had until now, so I would go for it.
      4aef9b49
    • Damian Hofmann's avatar
      Implement split-Rhat diagnostic to detect non-stationary MCMC chains (#1138) · a71a946c
      Damian Hofmann authored
      This PR introduces a flag to compute the split-R_hat diagnostic instead of the plain R_hat currently used. 
      
      Split-R_hat is able to additionally detect non-stationarity within single chains.
      
      See, e.g., Vehtari et al. (arXiv:1903.08008) for a modern discussion of this diagnostic (that paper points out some failure types that split-Rhat does not cover either and proposes an improved version, but let's do one step at a time here).
      
      Here is a very simple example featuring two (identical) linearly increasing and thus non-stationary chains:
      ```python
      # stats_example.py
      import netket as nk
      import numpy as np
      
      r = np.arange(100, dtype=float)
      x = np.array([r, r])
      print(nk.stats.statistics(x))
      ```
      which gives these results (split-Rhat is currently enabled by the NETKET_USE_SPLIT_RHAT flag in this PR):
      
      The non-split Rhat is happy (with R^ ≈ 1.0) because the chains do have identical mean and variance, whereas the split-chain version correctly identifies the failed MC convergence (R^ >> 1.01).
      a71a946c
  10. Mar 31, 2022
  11. Mar 30, 2022
  12. Mar 29, 2022
  13. Mar 18, 2022
  14. Mar 16, 2022
    • Clemens Giuliani's avatar
      support pytrees as diag_shift (#1135) · 4d705320
      Clemens Giuliani authored
      * support pytrees as diag_shift
      
      * add test
      
      * adapt test for dense and pytree
      (problem is finding the correct shape of shift when e.g. doing real-imag 
      split; ideally we should convert it in the constructor of the qgt)
      
      * black
      
      * isinstance instead of checking attr
      4d705320
  15. Mar 13, 2022
    • Damian Hofmann's avatar
      Only check for `HaikuFramework` if haiku is loaded (#1132) · 0ee21040
      Damian Hofmann authored
      Currently, using the JaxFramework model framework without haiku being installed causes an exception, because HaikuFramework.is_my_module (which tries to import haiku) is called anyways.
      
      This PR fixes this by only checking for haiku-based modules if haiku is already loaded.
      0ee21040
  16. Mar 07, 2022
    • Filippo Vicentini's avatar
      Remove custom code for LdagL/SteadyState gradient computation (#1128) · 1d789865
      Filippo Vicentini authored
      The special code for the steady state computation is quite old.
      With the big operator rewrite for chunking I did not realise it immediately, but I implemented a more efficient version of squared operator gradient.
      
      This PR simply removes the old special code and falls back to using AD on nkjax.expect to compute gradient of LdagL.
      It's also 10% faster.
      1d789865
  17. Mar 02, 2022
  18. Mar 01, 2022
    • Enrico Rinaldi's avatar
      Fix link to Tutorials in README (#1129) · c37becf3
      Enrico Rinaldi authored
      * [fix] Removed extra 's' in link
      c37becf3
    • Filippo Vicentini's avatar
      Fix Squared Operator (#1127) · 52c23ce3
      Filippo Vicentini authored
      Cherry picked from #1065 so that i separate the two changes in two different PRs.
      
      Computing the gradient of operators that use nkjax.expect instead of the covariance formula (such as SquaredOperator) also had a wrong factor of 2 for C->C models.
      This is due to the weird way that Jax handles complex differentiation.
      
      This PR now fixes it, and a test is added to check the gradient wrt finite differences.
      
      Also, this PR moves out into a common test file the finite difference functions so that they can be used for other tests.
      52c23ce3
  19. Feb 28, 2022
  20. Feb 24, 2022
    • Dian Wu's avatar
      Support Windows (#1118) · 2e294f2f
      Dian Wu authored
      To support Windows, the most nasty thing is that the default size of some int is 32 bits rather than 64 bits, even on 64-bit Windows. (I didn't test it on 32-bit Windows, but come on it's 2022)
      
      Also, we need to correctly find mpicc because the default configuration of mpi4py on Windows does not provide it.
      2e294f2f
  21. Feb 23, 2022
  22. Feb 22, 2022
  23. Feb 21, 2022
  24. Feb 19, 2022
  25. Feb 18, 2022
Loading