Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

select pretrained configs for multihead replay with or without replacement? #432

Open
bernstei opened this issue May 30, 2024 · 2 comments

Comments

@bernstei
Copy link
Collaborator

atoms_list_pt_random = np.random.choice(

np.random.choice defaults to replace=True. Do we really want that for this selection call (and the nearby ones)?

@bernstei
Copy link
Collaborator Author

Also, this call fails when the objects in the list are Atoms.

bash-4.4$ cat t
import numpy as np
from ase.atoms import Atoms

l = [Atoms('H2'), Atoms('He2')]
np.random.choice(l, 1)


bash-4.4$ python3 t
Traceback (most recent call last):
  File "/home/cluster2/bernstei/src/work/NiOxHy/fit_iterative_stage_010/_expyre/run_070_MACE_fit_NiOxHy_MACE_fit_lPgYyu05kGnYajeJu5wzBxuJV1094EXFnTzKyVYkb4Y=_pnjs9mxr/run_020_MD_sample/070_MACE_fit/t", line 5, in <module>
    np.random.choice(l, 1)
  File "numpy/random/mtrand.pyx", line 946, in numpy.random.mtrand.RandomState.choice
ValueError: a must be 1-dimensional

@bernstei
Copy link
Collaborator Author

I can fix in a PR, but the answer to the replace=True question affects the way to do it (np.random.randint vs. np.random.choice(list(range(len(...))))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants