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

Updated README and fixed deprecated numpy dtype #506

Merged
merged 2 commits into from
Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ cd spk_workdir
Then, the training of a SchNet model with default settings for QM9 can be started by:

```
spktrain experiment=qm9_energy
spktrain experiment=qm9_atomwise
```

The script prints the defaults for the experiment config `qm9_energy`.
The script prints the defaults for the experiment config `qm9_atomwise`.
The dataset will be downloaded automatically to `spk_workdir/data`, if it does not exist yet.
Then, the training will be started.

Expand All @@ -96,15 +96,15 @@ that can be changed.
Nested parameters can be changed as follows:

```
spktrain experiment=qm9_energy data_dir=<path> data.batch_size=64
spktrain experiment=qm9_atomwise data_dir=<path> data.batch_size=64
```

Hydra organizes parameters in config groups which allows hierarchical configurations consisting of multiple
yaml files. This allows to easily change the whole dataset, model or representation.
For instance, changing from the default SchNet representation to PaiNN, use:

```
spktrain experiment=qm9_energy data_dir=<path> model/representation=painn
spktrain experiment=qm9_atomwise data_dir=<path> model/representation=painn
```

It is a bit confusing at first when to use "." or "/". The slash is used, if you are loading a preconfigured config
Expand All @@ -131,7 +131,7 @@ corresponds to the following part of the config:
If you would want to additionally change some value of this group, you could use:

```
spktrain experiment=qm9_energy data_dir=<path> model/representation=painn model.representation.n_interactions=5
spktrain experiment=qm9_atomwise data_dir=<path> model/representation=painn model.representation.n_interactions=5
```

For more details on config groups, have a look at the
Expand Down
10 changes: 5 additions & 5 deletions docs/getstarted.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ First, create a working directory, where all data and runs will be stored::

Then, the training of a SchNet model with default settings for QM9 can be started by::

$ spktrain experiment=qm9_energy
$ spktrain experiment=qm9_atomwise

The script prints the defaults for the experiment config ``qm9_energy``.
The script prints the defaults for the experiment config ``qm9_atomwise``.
The dataset will be downloaded automatically to ``spk_workdir/data``, if it does not exist yet.
Then, the training will be started.

Expand All @@ -82,13 +82,13 @@ If you call ``spktrain experiment=qm9 --help``, you can see the full config with
that can be changed.
Nested parameters can be changed as follows::

$ spktrain experiment=qm9_energy data_dir=<path> data.batch_size=64
$ spktrain experiment=qm9_atomwise data_dir=<path> data.batch_size=64

Hydra organizes parameters in config groups which allows hierarchical configurations consisting of multiple
yaml files. This allows to easily change the whole dataset, model or representation.
For instance, changing from the default SchNet representation to PaiNN, use::

$ spktrain experiment=qm9_energy data_dir=<path> model/representation=painn
$ spktrain experiment=qm9_atomwise data_dir=<path> model/representation=painn

It is a bit confusing at first when to use "." or "/". The slash is used, if you are loading a preconfigured config
group, while the dot is used changing individual values. For example, the config group "model/representation"
Expand All @@ -111,7 +111,7 @@ corresponds to the following part of the config: ::

If you would want to additionally change some value of this group, you could use: ::

$ spktrain experiment=qm9_energy data_dir=<path> model/representation=painn model.representation.n_interactions=5
$ spktrain experiment=qm9_atomwise data_dir=<path> model/representation=painn model.representation.n_interactions=5

For more details on config groups, have a look at the
`Hydra docs <https://hydra.cc/docs/next/tutorials/basic/your_first_app/config_groups>`_.
Expand Down
4 changes: 2 additions & 2 deletions docs/userguide/configs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -355,12 +355,12 @@ directly at the command line instead of creating a separate config file for each
them. When changing a single value, such as the learning rate, you can use the following
notation::

$ spktrain experiment=qm9_energy globals.lr=1e-4
$ spktrain experiment=qm9_atomwise globals.lr=1e-4

Alternatively, one can also change a whole config group. The syntax for this is slightly
different::

$ spktrain experiment=qm9_energy model/representation=schnet
$ spktrain experiment=qm9_atomwise model/representation=schnet

The difference here is that ``schnet`` refers to a pre-defined subconfig, instead of a
single value. The config would be changed by this as follows::
Expand Down
4 changes: 2 additions & 2 deletions src/schnetpack/datasets/qm9.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,9 @@ def _download_data(

property_list = []

irange = np.arange(len(ordered_files), dtype=np.int)
irange = np.arange(len(ordered_files), dtype=int)
if uncharacterized is not None:
irange = np.setdiff1d(irange, np.array(uncharacterized, dtype=np.int) - 1)
irange = np.setdiff1d(irange, np.array(uncharacterized, dtype=int) - 1)

for i in tqdm(irange):
xyzfile = os.path.join(raw_path, ordered_files[i])
Expand Down
4 changes: 2 additions & 2 deletions src/schnetpack/datasets/rmd17.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def _download_data(
os.path.join(raw_path, "rmd17", "splits", f"index_train_0{i}.csv")
)
.flatten()
.astype(np.int)
.astype(int)
.tolist()
)
train_splits.append(train_split)
Expand All @@ -250,7 +250,7 @@ def _download_data(
os.path.join(raw_path, "rmd17", "splits", f"index_test_0{i}.csv")
)
.flatten()
.astype(np.int)
.astype(int)
.tolist()
)
test_splits.append(test_split)
Expand Down