Skip to content

Commit

Permalink
Update docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shyue Ping Ong committed Aug 11, 2023
1 parent 561ffd6 commit 24eae9c
Show file tree
Hide file tree
Showing 9 changed files with 1,168 additions and 2,972 deletions.
5 changes: 5 additions & 0 deletions docs/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ nav_order: 3

# Change Log

## 0.8.2
- Add site-wise predictions for Potential. (@lbluque)
- Enable CLI tool to be used for multi-fidelity models. (@kenko911)
- Minor fix for model version for DIRECT model.

## 0.8.1
- Fixed bug with loading of models trained with GPUs.
- Updated default model for relaxations to be the `M3GNet-MP-2021.2.8-DIRECT-PES model`.
Expand Down
68 changes: 16 additions & 52 deletions docs/matgl.apps.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,65 +14,29 @@ potentials parameterizing the potential energy surface (PES).

Implementation of Interatomic Potentials.

### *class* matgl.apps.pes.Potential(model: nn.Module, data_mean: torch.Tensor | None = None, data_std: torch.Tensor | None = None, element_refs: np.ndarray | None = None, calc_forces: bool = True, calc_stresses: bool = True, calc_hessian: bool = False, calc_site_wise: bool = False)

### _class_ matgl.apps.pes.Potential(model: nn.Module, data_mean: torch.Tensor | None = None, data_std: torch.Tensor | None = None, element_refs: np.ndarray | None = None, calc_forces: bool = True, calc_stresses: bool = True, calc_hessian: bool = False)
Bases: `Module`, [`IOMixIn`](matgl.utils.md#matgl.utils.io.IOMixIn)

A class representing an interatomic potential.

Initialize Potential from a model and elemental references.


* **Parameters**


* **model** – Model for predicting energies.


* **data_mean** – Mean of target.


* **data_std** – Std dev of target.


* **element_refs** – Element reference values for each element.


* **calc_forces** – Enable force calculations.


* **calc_stresses** – Enable stress calculations.


* **calc_hessian** – Enable hessian calculations.


* **Parameters:**
* **model** – Model for predicting energies.
* **data_mean** – Mean of target.
* **data_std** – Std dev of target.
* **element_refs** – Element reference values for each element.
* **calc_forces** – Enable force calculations.
* **calc_stresses** – Enable stress calculations.
* **calc_hessian** – Enable hessian calculations.
* **calc_site_wise** – Enable site-wise property calculation.

#### forward(g: dgl.DGLGraph, state_attr: torch.Tensor | None = None, l_g: dgl.DGLGraph | None = None)

* **Parameters**


* **g** – DGL graph


* **state_attr** – State attrs


* **l_g** – Line graph.



* **Returns**

torch.Tensor



* **Return type**

energies, forces, stresses, hessian



#### training(_: boo_ )
* **Parameters:**
* **g** – DGL graph
* **state_attr** – State attrs
* **l_g** – Line graph.
* **Returns:**
(energies, forces, stresses, hessian) or (energies, forces, stresses, hessian, site-wise properties)
140 changes: 43 additions & 97 deletions docs/matgl.data.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,141 +13,87 @@ This package implements data manipulation tools.

Module implementing various data transformers for PyTorch.

### *class* matgl.data.transformer.LogTransformer

### _class_ matgl.data.transformer.LogTransformer()
Bases: `Transformer`
Bases: [`Transformer`](#matgl.data.transformer.Transformer)

Performs a natural log of the data.


#### inverse_transform(data)
Invert the log (exp).


* **Parameters**

**data** – Input data



* **Returns**

exp(data)

Invert the log (exp).

* **Parameters:**
**data** – Input data
* **Returns:**
exp(data)

#### transform(data)
Take the log of the data.


* **Parameters**

**data** – Input data



* **Returns**

Scaled data
Take the log of the data.

* **Parameters:**
**data** – Input data
* **Returns:**
Scaled data

### *class* matgl.data.transformer.Normalizer(mean: float, std: float)

### _class_ matgl.data.transformer.Normalizer(mean: float, std: float)
Bases: `Transformer`
Bases: [`Transformer`](#matgl.data.transformer.Transformer)

Performs a scaling of the data by centering to the mean and dividing by the standard deviation.

* **Parameters:**
* **mean** – Mean of the data
* **std** – Standard deviation of the data.

* **Parameters**


* **mean** – Mean of the data


* **std** – Standard deviation of the data.


#### *classmethod* from_data(data)

#### _classmethod_ from_data(data)
Create Normalizer from data.


* **Parameters**

**data** – Input data.



* **Returns**

Normalizer


* **Parameters:**
**data** – Input data.
* **Returns:**
Normalizer

#### inverse_transform(data)
Invert the scaling.


* **Parameters**

**data** – Scaled data



* **Returns**

Unscaled data

Invert the scaling.

* **Parameters:**
**data** – Scaled data
* **Returns:**
Unscaled data

#### transform(data)
z-score the data by subtracting the mean and dividing by the standard deviation.


* **Parameters**

**data** – Input data



* **Returns**

Scaled data
z-score the data by subtracting the mean and dividing by the standard deviation.

* **Parameters:**
**data** – Input data
* **Returns:**
Scaled data

### *class* matgl.data.transformer.Transformer

### _class_ matgl.data.transformer.Transformer()
Bases: `object`

Abstract base class defining a data transformer.

#### *abstract* inverse_transform(data: Tensor)

#### _abstract_ inverse_transform(data: Tensor)
Inverse transformation to be performed on data.

* **Parameters:**
**data** – Input data
* **Returns:**
Inverse-transformed data.

* **Parameters**

**data** – Input data



* **Returns**

Inverse-transformed data.

#### *abstract* transform(data: Tensor)


#### _abstract_ transform(data: Tensor)
Transformation to be performed on data.


* **Parameters**

**data** – Input data



* **Returns**

Transformed data.
* **Parameters:**
**data** – Input data
* **Returns:**
Transformed data.
Loading

0 comments on commit 24eae9c

Please sign in to comment.