Skip to content

Commit 5c0b7db

Browse files
committed
update docs for reference
1 parent 93468d6 commit 5c0b7db

17 files changed

Lines changed: 119 additions & 85 deletions

File tree

docs/source/additional.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ Project Overview
66
Main components:
77

88
1. **Predictive Models**
9-
- ✔ GREA, SGIR, IRM, GIN/GCN w/ virtual, DIR
10-
- ⏳ SMILES-based LSTM/Transformers and more
9+
- ✔ GREA, SGIR, IRM, GIN/GCN w/ virtual, DIR
10+
- ✔ SMILES-based LSTM/Transformers
11+
- ⏳ More models
1112

1213
2. **Generative Models**
13-
- ✔ Graph DiT, GraphGA, DiGress
14+
- ✔ Graph DiT, GraphGA, DiGress, MolGPT
1415
- ⏳ GDSS and more
1516

1617
3. **Representation Models**

docs/source/api/encoder.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,19 @@ Molecular Encoder Models
33

44
The encoder models inherit from the :class:`torch_molecule.base.encoder.BaseMolecularEncoder` class and share common methods for model pretraining and encoding, as well as model persistence.
55

6-
Common Methods
7-
--------------
6+
.. rubric:: Training and Encoding
87

9-
Training and Encoding
10-
^^^^^^^^^^^^^^^^^^^^^^^
118
- ``fit(X, **kwargs)``: Pretrain the model on given data, where X contains SMILES strings
129

1310
Not implemented for:
1411
- N/A
1512

1613
- ``encode(X, **kwargs)``: Encode new SMILES strings and return a dictionary containing encoded representations
1714

18-
Model Persistence
19-
^^^^^^^^^^^^^^^^^
15+
.. rubric:: Model Persistence
16+
17+
inherited from :class:`torch_molecule.base.base.BaseModel`
18+
2019
- ``save_to_local(path)``: Save the trained model to a local file
2120
- ``load_from_local(path)``: Load a trained model from a local file
2221
- ``push_to_huggingface(repo_id)``: Push the model to Hugging Face Hub

docs/source/api/generator.rst

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,26 @@ Molecular Generation Models
33

44
The generator models inherit from the :class:`torch_molecule.base.generator.BaseMolecularGenerator` class and share common methods for model training, generation and persistence.
55

6-
Common Methods
7-
-------------
6+
.. rubric:: Training and Generation
87

9-
Training and Generation
10-
^^^^^^^^^^^^^^^^^^^^^^^
118
- ``fit(X, **kwargs)``: Train the model on given data, where X contains SMILES strings (y should be provided for conditional generation)
129
- ``generate(n_samples, **kwargs)``: Generate new molecules and return a list of SMILES strings (y should be provided for conditional generation)
1310

14-
Model Persistence
15-
^^^^^^^^^^^^^^^^^
11+
.. rubric:: Model Persistence
12+
13+
inherited from :class:`torch_molecule.base.base.BaseModel`
14+
1615
- ``save_to_local(path)``: Save the trained model to a local file
1716
- ``load_from_local(path)``: Load a trained model from a local file
1817
- ``push_to_huggingface(repo_id)``: Push the model to Hugging Face Hub
1918

2019
Not implemented for:
21-
- :class:`torch_molecule.generator.graph_ga.GraphGAMolecularGenerator`
20+
- :class:`torch_molecule.generator.graph_ga.modeling_graph_ga.GraphGAMolecularGenerator`
2221

2322
- ``load_from_huggingface(repo_id)``: Load a model from Hugging Face Hub
2423

2524
Not implemented for:
26-
- :class:`torch_molecule.generator.graph_ga.GraphGAMolecularGenerator`
25+
- :class:`torch_molecule.generator.graph_ga.modeling_graph_ga.GraphGAMolecularGenerator`
2726

2827
- ``save``: Save the model to either local storage or Hugging Face
2928
- ``load``: Load a model from either local storage or Hugging Face

docs/source/api/predictor.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@ Molecular Property Prediction Models
33

44
The predictor models inherit from the :class:`torch_molecule.base.predictor.BaseMolecularPredictor` class and share common methods for model training, evaluation, prediction and persistence.
55

6-
Common Methods
7-
--------------
6+
.. rubric:: Training and Prediction
87

9-
Training and Prediction
10-
^^^^^^^^^^^^^^^^^^^^^^^
118
- ``fit(X, y, **kwargs)``: Train the model on given data, where X contains SMILES strings and y contains target values
129
- ``autofit(X, y, search_parameters, n_trials=50, **kwargs)``: Automatically search for optimal hyperparameters using Optuna and train the model
1310
- ``predict(X, **kwargs)``: Make predictions on new SMILES strings and return a dictionary containing predictions and optional uncertainty estimates
1411

15-
Model Persistence
16-
^^^^^^^^^^^^^^^^^
12+
.. rubric:: Model Persistence
13+
14+
inherited from :class:`torch_molecule.base.base.BaseModel`
15+
1716
- ``save_to_local(path)``: Save the trained model to a local file
1817
- ``load_from_local(path)``: Load a trained model from a local file
1918
- ``push_to_huggingface(repo_id)``: Push the model to Hugging Face Hub

torch_molecule/encoder/moama/modeling_moama.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@
2121
class MoamaMolecularEncoder(BaseMolecularEncoder):
2222
"""This encoder implements Motif-aware Attribute Masking for Molecular Graph Pre-training.
2323
24-
Paper: https://openreview.net/forum?id=uqPnesiGGi
25-
Code: https://github.com/einae-nd/MoAMa-dev
24+
References
25+
----------
26+
- Paper: https://openreview.net/forum?id=uqPnesiGGi
27+
- Code: https://github.com/einae-nd/MoAMa-dev
2628
2729
Parameters
2830
----------

torch_molecule/generator/digress/modeling_digress.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
@dataclass
1919
class DigressMolecularGenerator(BaseMolecularGenerator):
2020
"""
21-
This generator implements the DiGress model for unconditional molecular generation.
21+
This generator implements the DiGress for unconditional molecular generation.
2222
2323
References
2424
----------
25-
.. [1] DiGress: Discrete Denoising diffusion for graph generation. International Conference on
26-
Learning Representations (ICLR) 2023. https://openreview.net/forum?id=UaAD-Nu86WX
27-
.. [2] Adapted from: https://github.com/cvignac/DiGress
25+
- DiGress: Discrete Denoising diffusion for graph generation. International Conference on
26+
Learning Representations (ICLR) 2023. https://openreview.net/forum?id=UaAD-Nu86WX
27+
- Code: https://github.com/cvignac/DiGress
2828
2929
:param hidden_size_X: Hidden dimension size for node features, defaults to 256
3030
:type hidden_size_X: int, optional

torch_molecule/generator/graph_dit/modeling_graph_dit.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,14 @@
1818
@dataclass
1919
class GraphDITMolecularGenerator(BaseMolecularGenerator):
2020
"""
21-
This generator implements the graph diffusion transformer for
22-
(multi-conditional and unconditional) molecular generation.
21+
This generator implements the graph diffusion transformer for (multi-conditional and unconditional) molecular generation.
2322
2423
References
2524
----------
26-
.. [1] Graph Diffusion Transformers for Multi-Conditional Molecular Generation.
27-
International Conference on Learning Representations (ICLR) 2024.
28-
https://openreview.net/forum?id=cfrDLD1wfO
29-
.. [2] Implementation: https://github.com/liugangcode/Graph-DiT
25+
- Graph Diffusion Transformers for Multi-Conditional Molecular Generation.
26+
International Conference on Learning Representations (ICLR) 2024.
27+
https://openreview.net/forum?id=cfrDLD1wfO
28+
- Implementation: https://github.com/liugangcode/Graph-DiT
3029
3130
Parameters
3231
----------

torch_molecule/generator/graph_ga/modeling_graph_ga.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,27 @@ class GraphGAMolecularGenerator(BaseMolecularGenerator):
2424
2525
References
2626
----------
27-
.. [1] A Graph-BasedGenetic Algorithm and Its Application to the Multiobjective Evolution of
27+
- A Graph-Based Genetic Algorithm and Its Application to the Multiobjective Evolution of
2828
Median Molecules. Journal of Chemical Information and Computer Sciences.
2929
https://pubs.acs.org/doi/10.1021/ci034290p
30-
.. [2] Implementation adapted from: https://github.com/wenhao-gao/mol_opt
30+
- Implementation: https://github.com/wenhao-gao/mol_opt
3131
32-
:param num_task: Number of properties to condition on. Set to 0 for unconditional generation. Default is 0.
33-
:type num_task: int
34-
:param population_size: Size of the population in each iteration. Default is 100.
35-
:type population_size: int
36-
:param offspring_size: Number of offspring molecules to generate in each iteration. Default is 50.
37-
:type offspring_size: int
38-
:param mutation_rate: Probability of mutation occurring during reproduction. Default is 0.0067.
39-
:type mutation_rate: float
40-
:param n_jobs: Number of parallel jobs to run. -1 means using all processors. Default is 1.
41-
:type n_jobs: int
42-
:param iteration: Number of iterations for each target label (or random sample) to run the genetic algorithm. Default is 5.
43-
:type iteration: int
44-
:param verbose: Whether to display progress bars and logs. Default is False.
45-
:type verbose: bool
32+
Parameters
33+
----------
34+
num_task : int, default=0
35+
Number of properties to condition on. Set to 0 for unconditional generation.
36+
population_size : int, default=100
37+
Size of the population in each iteration.
38+
offspring_size : int, default=50
39+
Number of offspring molecules to generate in each iteration.
40+
mutation_rate : float, default=0.0067
41+
Probability of mutation occurring during reproduction.
42+
n_jobs : int, default=1
43+
Number of parallel jobs to run. -1 means using all processors.
44+
iteration : int, default=5
45+
Number of iterations for each target label (or random sample) to run the genetic algorithm.
46+
verbose : bool, default=False
47+
Whether to display progress bars and logs.
4648
"""
4749

4850
# GA parameters

torch_molecule/generator/molgpt/modeling_molgpt.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ class MolGPTMolecularGenerator(BaseMolecularGenerator):
2626
2727
References
2828
----------
29-
.. [1] MolGPT:Molecular Generation Using a Transformer-Decoder Model. Journal of Chemical
30-
Information and Modeling. https://pubs.acs.org/doi/10.1021/acs.jcim.1c00600
31-
.. [2] Adapted from: https://github.com/devalab/molgpt
29+
- MolGPT: Molecular Generation Using a Transformer-Decoder Model. Journal of Chemical
30+
Information and Modeling. https://pubs.acs.org/doi/10.1021/acs.jcim.1c00600
31+
- Code: https://github.com/devalab/molgpt
3232
3333
Parameters
3434
----------

torch_molecule/predictor/dir/modeling_dir.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,16 @@
1818

1919
@dataclass
2020
class DIRMolecularPredictor(GNNMolecularPredictor):
21-
"""This predictor implements the DIR model for discovering the invariant rationales.
21+
"""This predictor implements the DIR for molecular property prediction tasks.
2222
23-
Paper: `Discovering Invariant Rationales for Graph Neural Networks <https://openreview.net/forum?id=hGXij5rfiHw>`_
24-
25-
Reference Code: https://github.com/Wuyxin/DIR-GNN
26-
23+
The full name of DIR is Discovering Invariant Rationales.
24+
25+
References
26+
----------
27+
- Discovering Invariant Rationales for Graph Neural Networks.
28+
https://openreview.net/forum?id=hGXij5rfiHw
29+
- Code: https://github.com/Wuyxin/DIR-GNN
30+
2731
Parameters
2832
----------
2933
causal_ratio : float, default=0.8

0 commit comments

Comments
 (0)