Skip to content

Commit

Permalink
upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
jzhang-github committed Sep 16, 2023
1 parent a32b76f commit d77d032
Show file tree
Hide file tree
Showing 23 changed files with 264 additions and 44 deletions.
26 changes: 15 additions & 11 deletions Change_log.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
# [main](https://github.com/jzhang-github/AGAT/tree/main)
- Fix bugs in high-throughput predict:
- [agat/app/cata/generate_adsorption_sites.py](https://github.com/jzhang-github/AGAT/tree/main/agat/app/cata/generate_adsorption_sites.py#L218)
- [agat/app/cata/high_throughput_predict.py](https://github.com/jzhang-github/AGAT/tree/main/agat/app/cata/high_throughput_predict.py#L207)
- [agat/app/cata/high_throughput_predict.py](https://github.com/jzhang-github/AGAT/tree/main/agat/app/cata/high_throughput_predict.py#L250)
- [agat/app/cata/high_throughput_predict.py](https://github.com/jzhang-github/AGAT/tree/main/agat/app/cata/high_throughput_predict.py#L291)
- [agat/app/GatApp.py](https://github.com/jzhang-github/AGAT/tree/main/agat/app/GatApp.py#L69-L70)
- [agat/default_parameters.py](https://github.com/jzhang-github/AGAT/tree/main/agat/default_parameters.py#L133)

- Deprecate redundant training configurations: train_energy_model, train_force_model, new_energy_train, new_force_train, load_graphs_on_gpu,

- Modify high-throughput predictions: (These changes are deprecated.)
- [agat/app/cata/high_throughput_predict.py#L160](https://github.com/jzhang-github/AGAT/tree/main/agat/app/cata/high_throughput_predict.py#L160), [L169](https://github.com/jzhang-github/AGAT/tree/main/agat/app/cata/high_throughput_predict.py#L169), [L172](https://github.com/jzhang-github/AGAT/tree/main/agat/app/cata/high_throughput_predict.py#L172), [L218](https://github.com/jzhang-github/AGAT/tree/main/agat/app/cata/high_throughput_predict.py#L218), [L245](https://github.com/jzhang-github/AGAT/tree/main/agat/app/cata/high_throughput_predict.py#L245), [L284](https://github.com/jzhang-github/AGAT/tree/main/agat/app/cata/high_throughput_predict.py#L284)
# [v7.13.2](https://github.com/jzhang-github/AGAT/tree/v7.13.2)
- Fix bugs in high-throughput predict:
- [agat/app/cata/generate_adsorption_sites.py](https://github.com/jzhang-github/AGAT/tree/v7.13.2/agat/app/cata/generate_adsorption_sites.py#L218)
- [agat/app/cata/high_throughput_predict.py](https://github.com/jzhang-github/AGAT/tree/v7.13.2/agat/app/cata/high_throughput_predict.py#L207)
- [agat/app/cata/high_throughput_predict.py](https://github.com/jzhang-github/AGAT/tree/v7.13.2/agat/app/cata/high_throughput_predict.py#L250)
- [agat/app/cata/high_throughput_predict.py](https://github.com/jzhang-github/AGAT/tree/v7.13.2/agat/app/cata/high_throughput_predict.py#L291)
- [agat/app/GatApp.py](https://github.com/jzhang-github/AGAT/tree/v7.13.2ain/agat/app/GatApp.py#L69-L70)
- [agat/default_parameters.py](https://github.com/jzhang-github/AGAT/tree/v7.13.2/agat/default_parameters.py#L133)

- Deprecate redundant training configurations:
- `train_energy_model`: [agat/model/ModelFit.py](https://github.com/jzhang-github/AGAT/tree/v7.13.2/agat/model/ModelFit.py#L96) and [agat/model/ModelFit.py](https://github.com/jzhang-github/AGAT/tree/v7.13.2/agat/model/ModelFit.py#L198)
- `train_force_model`: [agat/model/ModelFit.py](https://github.com/jzhang-github/AGAT/tree/v7.13.2/agat/model/ModelFit.py#L274) and [agat/model/ModelFit.py](https://github.com/jzhang-github/AGAT/tree/v7.13.2/agat/model/ModelFit.py#L398)
- `new_energy_train`
- `new_force_train`
- `load_graphs_on_gpu`

# [v7.13.1](https://github.com/jzhang-github/AGAT/tree/v7.13.1)
- Fix a bug here: [agat/model/ModelFit.py](https://github.com/jzhang-github/AGAT/tree/v7.13.1/agat/model/ModelFit.py#L243)
Expand Down
2 changes: 1 addition & 1 deletion agat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@author: ZHANG Jun
"""

__version__ = '7.13。1'
__version__ = '7.13.2'

import os
os.environ['DGLBACKEND']="tensorflow"
Expand Down
4 changes: 0 additions & 4 deletions agat/default_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,8 @@

default_train_config = {
'dataset_path': 'dataset',
'train_energy_model': True,
'train_force_model': True,
'epochs': 1000,
'output_files': 'out_file',
'new_energy_train': False,
'new_force_train': False,
'gpu_for_energy_train': 0,
'gpu_for_force_train': 0,
'load_graphs_on_gpu': False, # deprecated
Expand Down
8 changes: 4 additions & 4 deletions agat/model/ModelFit.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def fit_energy_model(self):
negative_slope=self.train_config['negative_slope'])

# early stop
if self.train_config['early_stop'] and self.train_config['train_energy_model']:
if self.train_config['early_stop']: # and self.train_config['train_energy_model']
stopper = EarlyStopping(energy_model, self.graph_eg, energy_log,
patience=self.train_config['stop_patience'],
folder=os.path.join(self.train_config['output_files'], 'energy_ckpt'))
Expand Down Expand Up @@ -195,7 +195,7 @@ def fit_energy_model(self):
PearsonR(en_true_all, en_pred_all), val_mae,
PearsonR(en_val_true, en_val_pred), dur),file=energy_log)

if self.train_config['early_stop'] and self.train_config['train_energy_model']:
if self.train_config['early_stop']: # and self.train_config['train_energy_model']
if stopper.step(val_mae, energy_model):
print('User log: model summary:', file=energy_log)
energy_model.summary()
Expand Down Expand Up @@ -271,7 +271,7 @@ def fit_force_model(self):
tail_readout_no_act=self.train_config['tail_readout_noact'])

# early stop
if self.train_config['early_stop'] and self.train_config['train_force_model']:
if self.train_config['early_stop']: # and self.train_config['train_force_model']
stopper = EarlyStopping(model, self.graph_eg, logf,
patience=self.train_config['stop_patience'],
folder=os.path.join(self.train_config['output_files'], 'force_ckpt'))
Expand Down Expand Up @@ -395,7 +395,7 @@ def fit_force_model(self):
force_val_mae, PearsonR(tf.reshape(force_val_true, [-1]), tf.reshape(force_val_pred, [-1])), dur),
file=logf)

if self.train_config['early_stop'] and self.train_config['train_force_model']:
if self.train_config['early_stop']: # and self.train_config['train_force_model']
if stopper.step(force_val_mae, model):
print('User log: model summary:', file=logf)
model.summary()
Expand Down
Binary file added dist/agat-7.13.2-py3-none-any.whl
Binary file not shown.
Binary file added dist/agat-7.13.2.tar.gz
Binary file not shown.
12 changes: 8 additions & 4 deletions docs/Change_log.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="v7.13.1" href="Change_log/Change_log.html" />
<link rel="next" title="main" href="Change_log/Change_log.html" />
<link rel="prev" title="generate_adsorption_sites_ase" href="API_Docs/generate_adsorption_sites_ase.html" />
</head>

Expand Down Expand Up @@ -105,7 +105,9 @@
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">Change log</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#energy-model">Energy model</a><ul>
<li class="toctree-l3"><a class="reference internal" href="Change_log/Change_log.html">v7.13.1</a></li>
<li class="toctree-l3"><a class="reference internal" href="Change_log/Change_log.html">main</a></li>
<li class="toctree-l3"><a class="reference internal" href="Change_log/Change_log.html#v7-13-2">v7.13.2</a></li>
<li class="toctree-l3"><a class="reference internal" href="Change_log/Change_log.html#v7-13-1">v7.13.1</a></li>
<li class="toctree-l3"><a class="reference internal" href="Change_log/Change_log.html#v7-13">v7.13</a></li>
<li class="toctree-l3"><a class="reference internal" href="Change_log/Change_log.html#v7-12-2">v7.12.2</a></li>
<li class="toctree-l3"><a class="reference internal" href="Change_log/Change_log.html#v7-12-1">v7.12.1</a></li>
Expand Down Expand Up @@ -189,7 +191,9 @@ <h1>Change log<a class="headerlink" href="#change-log" title="Permalink to this
<h2>Energy model<a class="headerlink" href="#energy-model" title="Permalink to this heading"></a></h2>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="Change_log/Change_log.html">v7.13.1</a></li>
<li class="toctree-l1"><a class="reference internal" href="Change_log/Change_log.html">main</a></li>
<li class="toctree-l1"><a class="reference internal" href="Change_log/Change_log.html#v7-13-2">v7.13.2</a></li>
<li class="toctree-l1"><a class="reference internal" href="Change_log/Change_log.html#v7-13-1">v7.13.1</a></li>
<li class="toctree-l1"><a class="reference internal" href="Change_log/Change_log.html#v7-13">v7.13</a></li>
<li class="toctree-l1"><a class="reference internal" href="Change_log/Change_log.html#v7-12-2">v7.12.2</a></li>
<li class="toctree-l1"><a class="reference internal" href="Change_log/Change_log.html#v7-12-1">v7.12.1</a></li>
Expand All @@ -208,7 +212,7 @@ <h2>Energy model<a class="headerlink" href="#energy-model" title="Permalink to t

<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">

<a href="Change_log/Change_log.html" class="btn btn-neutral float-right" title="v7.13.1" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="Change_log/Change_log.html" class="btn btn-neutral float-right" title="main" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>


<a href="API_Docs/generate_adsorption_sites_ase.html" class="btn btn-neutral float-left" title="generate_adsorption_sites_ase" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
Expand Down
39 changes: 34 additions & 5 deletions docs/Change_log/Change_log.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>v7.13.1 &mdash; AGAT 2022.10.04 documentation</title>
<title>main &mdash; AGAT 2022.10.04 documentation</title>



Expand Down Expand Up @@ -105,7 +105,9 @@
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../Change_log.html">Change log</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="../Change_log.html#energy-model">Energy model</a><ul class="current">
<li class="toctree-l3 current"><a class="current reference internal" href="#">v7.13.1</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">main</a></li>
<li class="toctree-l3"><a class="reference internal" href="#v7-13-2">v7.13.2</a></li>
<li class="toctree-l3"><a class="reference internal" href="#v7-13-1">v7.13.1</a></li>
<li class="toctree-l3"><a class="reference internal" href="#v7-13">v7.13</a></li>
<li class="toctree-l3"><a class="reference internal" href="#v7-12-2">v7.12.2</a></li>
<li class="toctree-l3"><a class="reference internal" href="#v7-12-1">v7.12.1</a></li>
Expand Down Expand Up @@ -166,7 +168,7 @@

<li><a href="../Change_log.html">Change log</a> &raquo;</li>

<li>v7.13.1</li>
<li>main</li>


<li class="wy-breadcrumbs-aside">
Expand All @@ -185,11 +187,38 @@
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">

<section id="v7-13-1">
<section id="main">
<h1><a class="reference external" href="https://github.com/jzhang-github/AGAT/tree/main">main</a><a class="headerlink" href="#main" title="Permalink to this heading"></a></h1>
</section>
<section id="v7-13-2">
<h1><a class="reference external" href="https://github.com/jzhang-github/AGAT/tree/v7.13.2">v7.13.2</a><a class="headerlink" href="#v7-13-2" title="Permalink to this heading"></a></h1>
<ul class="simple">
<li><p>Fix bugs in high-throughput predict:</p>
<ul>
<li><p><a class="reference external" href="https://github.com/jzhang-github/AGAT/tree/v7.13.2/agat/app/cata/generate_adsorption_sites.py#L218">agat/app/cata/generate_adsorption_sites.py</a></p></li>
<li><p><a class="reference external" href="https://github.com/jzhang-github/AGAT/tree/v7.13.2/agat/app/cata/high_throughput_predict.py#L207">agat/app/cata/high_throughput_predict.py</a></p></li>
<li><p><a class="reference external" href="https://github.com/jzhang-github/AGAT/tree/v7.13.2/agat/app/cata/high_throughput_predict.py#L250">agat/app/cata/high_throughput_predict.py</a></p></li>
<li><p><a class="reference external" href="https://github.com/jzhang-github/AGAT/tree/v7.13.2/agat/app/cata/high_throughput_predict.py#L291">agat/app/cata/high_throughput_predict.py</a></p></li>
<li><p><a class="reference external" href="https://github.com/jzhang-github/AGAT/tree/v7.13.2ain/agat/app/GatApp.py#L69-L70">agat/app/GatApp.py</a></p></li>
<li><p><a class="reference external" href="https://github.com/jzhang-github/AGAT/tree/v7.13.2/agat/default_parameters.py#L133">agat/default_parameters.py</a></p></li>
</ul>
</li>
<li><p>Deprecate redundant training configurations:</p>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">train_energy_model</span></code>: <a class="reference external" href="https://github.com/jzhang-github/AGAT/tree/v7.13.2/agat/model/ModelFit.py#L96">agat/model/ModelFit.py</a> and <a class="reference external" href="https://github.com/jzhang-github/AGAT/tree/v7.13.2/agat/model/ModelFit.py#L198">agat/model/ModelFit.py</a></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">train_force_model</span></code>: <a class="reference external" href="https://github.com/jzhang-github/AGAT/tree/v7.13.2/agat/model/ModelFit.py#L274">agat/model/ModelFit.py</a> and <a class="reference external" href="https://github.com/jzhang-github/AGAT/tree/v7.13.2/agat/model/ModelFit.py#L398">agat/model/ModelFit.py</a></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">new_energy_train</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">new_force_train</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">load_graphs_on_gpu</span></code></p></li>
</ul>
</li>
</ul>
</section>
<section id="v7-13-1">
<h1><a class="reference external" href="https://github.com/jzhang-github/AGAT/tree/v7.13.1">v7.13.1</a><a class="headerlink" href="#v7-13-1" title="Permalink to this heading"></a></h1>
<ul class="simple">
<li><p>Fix a bug here: <a class="reference external" href="https://github.com/jzhang-github/AGAT/tree/v7.13.1/agat/model/ModelFit.py#L243">agat/model/ModelFit.py</a></p></li>
<li><p>Load well-trained models: <a class="reference external" href="https://github.com/jzhang-github/AGAT/tree/v7.13.1/agat/model/GatEnergyModel.py#L154-L197">agat/model/GatEnergyModel.py</a> and <a class="reference external" href="https://github.com/jzhang-github/AGAT/tree/v7.13.1/agat/model/GatEnergyForce.py#L201-L246">agat/model/GatForceModel.py</a></p></li>
<li><p>Load well-trained models: <a class="reference external" href="https://github.com/jzhang-github/AGAT/tree/v7.13.1/agat/model/GatEnergyModel.py#L154-L197">agat/model/GatEnergyModel.py</a> and <a class="reference external" href="https://github.com/jzhang-github/AGAT/tree/v7.13.1/agat/model/GatForceModel.py#L201-L246">agat/model/GatForceModel.py</a></p></li>
<li><p>Test with best model after training. <a class="reference external" href="https://github.com/jzhang-github/AGAT/tree/v7.13.1/agat/model/ModelFit.py#L222">agat/model/ModelFit.py</a> and <a class="reference external" href="https://github.com/jzhang-github/AGAT/tree/v7.13.1/agat/model/ModelFit.py#L422">agat/model/ModelFit.py</a>.</p></li>
</ul>
</section>
Expand Down
67 changes: 66 additions & 1 deletion docs/Default parameters.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@
<li class="toctree-l2"><a class="reference internal" href="#default-elements"><code class="docutils literal notranslate"><span class="pre">default_elements</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="#default-build-properties"><code class="docutils literal notranslate"><span class="pre">default_build_properties</span> </code></a></li>
<li class="toctree-l2"><a class="reference internal" href="#default-data-config"><code class="docutils literal notranslate"><span class="pre">default_data_config</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="#default-train-config"><code class="docutils literal notranslate"><span class="pre">default_train_config</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="#default-ase-calculator-config"><code class="docutils literal notranslate"><span class="pre">default_ase_calculator_config</span></code>.</a></li>
<li class="toctree-l2"><a class="reference internal" href="#default-hp-config"><code class="docutils literal notranslate"><span class="pre">default_hp_config</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="Contribution.html">Contribution</a></li>
Expand Down Expand Up @@ -382,7 +385,69 @@ <h2><code class="docutils literal notranslate"><span class="pre">default_data_co
<td>Specify device when building graphs. Negative values for cpu; Positive <code>int</code> for GPU.</td>
</tr>
</tbody>
</table><p><strong>Note</strong>: More <code class="docutils literal notranslate"><span class="pre">num_of_cores</span></code> needs more memory. Weird results happen when you don’t have enough memory.</p>
</table></section>
<section id="default-train-config">
<h2><code class="docutils literal notranslate"><span class="pre">default_train_config</span></code><a class="headerlink" href="#default-train-config" title="Permalink to this heading"></a></h2>
</section>
<section id="default-ase-calculator-config">
<h2><code class="docutils literal notranslate"><span class="pre">default_ase_calculator_config</span></code>.<a class="headerlink" href="#default-ase-calculator-config" title="Permalink to this heading"></a></h2>
<p>See <a class="reference external" href="https://gitlab.com/ase/ase/-/blob/master/ase/optimize/bfgs.py">bfgs</a> for more details.</p>
<table border="1" class="docutils">
<thead>
<tr>
<th>Parameter</th>
<th>Default value</th>
<th>Alternative(s)</th>
<th>Explanation</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>fmax</code></td>
<td>0.1</td>
<td><code>float</code></td>
<td>Convergence criterion of atomic forces. Details: <a href="https://wiki.fysik.dtu.dk/ase/ase/optimize.html#local-optimization">ase optimizer</a></td>
</tr>
<tr>
<td><code>steps</code></td>
<td>200</td>
<td><code>int</code></td>
<td>Maximum iteration steps.</td>
</tr>
<tr>
<td><code>maxstep</code></td>
<td>0.05</td>
<td><code>float</code></td>
<td>maximum distance an atom can move per iteration, unit is Å.</td>
</tr>
<tr>
<td><code>restart</code></td>
<td><code>None</code></td>
<td><code>str</code></td>
<td>Pickle file used to store hessian matrix.</td>
</tr>
<tr>
<td><code>restart_steps</code></td>
<td>0</td>
<td><code>int</code></td>
<td>Restart optimization if the optimization cannot converge.</td>
</tr>
<tr>
<td><code>perturb_steps</code></td>
<td>0</td>
<td><code>int</code></td>
<td>Number of perturbated steps. AGAT may have issues in converging BFGS, perturbating atomic positions may help the convergence.</td>
</tr>
<tr>
<td><code>perturb_amplitude</code></td>
<td>0.05</td>
<td><code>float</code></td>
<td>Perturbation amplitudes if <code>erturb_steps</code> larger than <code>1</code>.</td>
</tr>
</tbody>
</table></section>
<section id="default-hp-config">
<h2><code class="docutils literal notranslate"><span class="pre">default_hp_config</span></code><a class="headerlink" href="#default-hp-config" title="Permalink to this heading"></a></h2>
</section>
</section>

Expand Down
Loading

0 comments on commit d77d032

Please sign in to comment.