Skip to content

Commit

Permalink
Updated docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shyue Ping Ong committed Jun 21, 2023
1 parent 3b88200 commit 8cab53b
Show file tree
Hide file tree
Showing 9 changed files with 607 additions and 13 deletions.
3 changes: 3 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ nav_order: 3

# Change Log

## 0.6.1
- Bug fix for training loss_fn.

## 0.6.0
- Refactoring of training utilities. Added example for training an M3GNet potential.

Expand Down
3 changes: 3 additions & 0 deletions docs/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ nav_order: 3

# Change Log

## 0.6.1
- Bug fix for training loss_fn.

## 0.6.0
- Refactoring of training utilities. Added example for training an M3GNet potential.

Expand Down
8 changes: 4 additions & 4 deletions docs/matgl.ext.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Get a DGL graph from an input Atoms.



### _class_ matgl.ext.ase.M3GNetCalculator(potential: [Potential](matgl.apps.md#matgl.apps.pes.Potential), state_attr: Tensor | None = None, stress_weight: float = 1.0, \*\*kwargs)
### _class_ matgl.ext.ase.M3GNetCalculator(potential: [Potential](matgl.apps.md#matgl.apps.pes.Potential), state_attr: torch.Tensor | None = None, stress_weight: float = 1.0, \*\*kwargs)
Bases: `Calculator`

M3GNet calculator for ASE.
Expand Down Expand Up @@ -101,11 +101,11 @@ Perform calculation for an input Atoms.



#### implemented_properties(_: List[str_ _ = ['energy', 'free_energy', 'forces', 'stress', 'hessian'_ )
#### implemented_properties(_: List[str_ _ = ('energy', 'free_energy', 'forces', 'stress', 'hessian'_ )
Properties calculator can handle (energy, forces, …)


### _class_ matgl.ext.ase.MolecularDynamics(atoms: Atoms, potential: [Potential](matgl.apps.md#matgl.apps.pes.Potential), state_attr: torch.Tensor = None, ensemble: str = 'nvt', temperature: int = 300, timestep: float = 1.0, pressure: float = 6.324209121801212e-07, taut: float | None = None, taup: float | None = None, compressibility_au: float | None = None, trajectory: str | Trajectory | None = None, logfile: str | None = None, loginterval: int = 1, append_trajectory: bool = False)
### _class_ matgl.ext.ase.MolecularDynamics(atoms: Atoms, potential: [Potential](matgl.apps.md#matgl.apps.pes.Potential), state_attr: torch.Tensor | None = None, ensemble: str = 'nvt', temperature: int = 300, timestep: float = 1.0, pressure: float = 6.324209121801212e-07, taut: float | None = None, taup: float | None = None, compressibility_au: float | None = None, trajectory: str | Trajectory | None = None, logfile: str | None = None, loginterval: int = 1, append_trajectory: bool = False)
Bases: `object`

Molecular dynamics class.
Expand Down Expand Up @@ -185,7 +185,7 @@ Set new atoms to run MD.



### _class_ matgl.ext.ase.Relaxer(potential: [Potential](matgl.apps.md#matgl.apps.pes.Potential) = None, state_attr: torch.Tensor = None, optimizer: Optimizer | str = 'FIRE', relax_cell: bool = True, stress_weight: float = 0.01)
### _class_ matgl.ext.ase.Relaxer(potential: [Potential](matgl.apps.md#matgl.apps.pes.Potential) | None = None, state_attr: torch.Tensor | None = None, optimizer: Optimizer | str = 'FIRE', relax_cell: bool = True, stress_weight: float = 0.01)
Bases: `object`

Relaxer is a class for structural relaxation.
Expand Down
6 changes: 1 addition & 5 deletions docs/matgl.models.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ Molecules and Crystals._ Chem. Mater. 2019, 31 (9), 3564-3572. DOI: 10.1021/acs.
```


### _class_ matgl.models._megnet.MEGNet(dim_node_embedding: int = 16, dim_edge_embedding: int = 100, dim_state_embedding: int = 2, ntypes_state: int | None = None, nblocks: int = 3, hidden_layer_sizes_input: tuple[int, ...] = (64, 32), hidden_layer_sizes_conv: tuple[int, ...] = (64, 64, 32), hidden_layer_sizes_output: tuple[int, ...] = (32, 16), nlayers_set2set: int = 1, niters_set2set: int = 2, activation_type: str = 'softplus2', is_classification: bool = False, include_state: bool = True, dropout: float | None = None, graph_transformations: list | None = None, element_types: tuple[str, ...] = ('H', 'He', 'Li', 'Be', 'B', 'C', 'N', 'O', 'F', 'Ne', 'Na', 'Mg', 'Al', 'Si', 'P', 'S', 'Cl', 'Ar', 'K', 'Ca', 'Sc', 'Ti', 'V', 'Cr', 'Mn', 'Fe', 'Co', 'Ni', 'Cu', 'Zn', 'Ga', 'Ge', 'As', 'Se', 'Br', 'Kr', 'Rb', 'Sr', 'Y', 'Zr', 'Nb', 'Mo', 'Tc', 'Ru', 'Rh', 'Pd', 'Ag', 'Cd', 'In', 'Sn', 'Sb', 'Te', 'I', 'Xe', 'Cs', 'Ba', 'La', 'Ce', 'Pr', 'Nd', 'Pm', 'Sm', 'Eu', 'Gd', 'Tb', 'Dy', 'Ho', 'Er', 'Tm', 'Yb', 'Lu', 'Hf', 'Ta', 'W', 'Re', 'Os', 'Ir', 'Pt', 'Au', 'Hg', 'Tl', 'Pb', 'Bi', 'Ac', 'Th', 'Pa', 'U', 'Np', 'Pu'), bond_expansion: [BondExpansion](matgl.layers.md#matgl.layers._bond.BondExpansion) | None = None, cutoff: float = 4.0, gauss_width: float = 0.5, \*\*kwargs)
### _class_ matgl.models._megnet.MEGNet(dim_node_embedding: int = 16, dim_edge_embedding: int = 100, dim_state_embedding: int = 2, ntypes_state: int | None = None, nblocks: int = 3, hidden_layer_sizes_input: tuple[int, ...] = (64, 32), hidden_layer_sizes_conv: tuple[int, ...] = (64, 64, 32), hidden_layer_sizes_output: tuple[int, ...] = (32, 16), nlayers_set2set: int = 1, niters_set2set: int = 2, activation_type: str = 'softplus2', is_classification: bool = False, include_state: bool = True, dropout: float | None = None, element_types: tuple[str, ...] = ('H', 'He', 'Li', 'Be', 'B', 'C', 'N', 'O', 'F', 'Ne', 'Na', 'Mg', 'Al', 'Si', 'P', 'S', 'Cl', 'Ar', 'K', 'Ca', 'Sc', 'Ti', 'V', 'Cr', 'Mn', 'Fe', 'Co', 'Ni', 'Cu', 'Zn', 'Ga', 'Ge', 'As', 'Se', 'Br', 'Kr', 'Rb', 'Sr', 'Y', 'Zr', 'Nb', 'Mo', 'Tc', 'Ru', 'Rh', 'Pd', 'Ag', 'Cd', 'In', 'Sn', 'Sb', 'Te', 'I', 'Xe', 'Cs', 'Ba', 'La', 'Ce', 'Pr', 'Nd', 'Pm', 'Sm', 'Eu', 'Gd', 'Tb', 'Dy', 'Ho', 'Er', 'Tm', 'Yb', 'Lu', 'Hf', 'Ta', 'W', 'Re', 'Os', 'Ir', 'Pt', 'Au', 'Hg', 'Tl', 'Pb', 'Bi', 'Ac', 'Th', 'Pa', 'U', 'Np', 'Pu'), bond_expansion: [BondExpansion](matgl.layers.md#matgl.layers._bond.BondExpansion) | None = None, cutoff: float = 4.0, gauss_width: float = 0.5, \*\*kwargs)
Bases: `Module`, [`IOMixIn`](matgl.utils.md#matgl.utils.io.IOMixIn)

DGL implementation of MEGNet.
Expand Down Expand Up @@ -251,10 +251,6 @@ Useful defaults for all arguments have been specified based on MEGNet formation
a Bernoulli distribution


* **graph_transformations** – Perform a graph transformation, e.g., incorporate three-body interactions, prior to
performing the GCL updates.


* **element_types** – Elements included in the training set


Expand Down
2 changes: 1 addition & 1 deletion docs/matgl.utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ Init ModelLightningModule with key parameters.



#### loss_fn(loss: Module, labels: tuple, preds: tuple)
#### loss_fn(loss: Module, labels: Tensor, preds: Tensor)

* **Parameters**

Expand Down
3 changes: 2 additions & 1 deletion docs/tutorials.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ This series of notebooks demonstrate how to load and use the pretrained models f

## Training MatGL models

1. [Training a M3GNet Potential with PyTorch Lightning](tutorials%2FTraining%20a%20M3GNet%20Potential%20with%20PyTorch%20Lightning.html)
1. [Training a MEGNet Formation Energy Model](tutorials%2FTraining%20a%20MEGNet%20Formation%20Energy%20Model%20with%20PyTorch%20Lightning.html)
2. [Training a M3GNet Potential](tutorials%2FTraining%20a%20M3GNet%20Potential%20with%20PyTorch%20Lightning.html)

[jupyternb]: https://github.com/materialsvirtuallab/matgl/tree/main/examples "Jupyter notebooks"
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ lit_module = PotentialLightningModule(model=model)
100%|███████████████████████████████████████████████████████████████████████████████████████| 407/407 [00:02<00:00, 202.56it/s]


Finally, we will initialize the Pytorch Lightning trainer and run the fitting. Here, the max_epochs is set to 2 just for demonstration purposes. In a real fitting, this would be a much larger number. Also, the `accelerator`
Finally, we will initialize the Pytorch Lightning trainer and run the fitting. Here, the max_epochs is set to 2 just for demonstration purposes. In a real fitting, this would be a much larger number. Also, the `accelerator="cpu"` was set just to ensure compatibility with M1 Macs. In a real world use case, please remove the kwarg or set it to cuda for GPU based training.


```python
Expand Down
Loading

0 comments on commit 8cab53b

Please sign in to comment.