Skip to content

Commit

Permalink
Eds mean fix (#226)
Browse files Browse the repository at this point in the history
* Fixed statistics reset on EDS

* Added to changelog
  • Loading branch information
whitead authored Aug 11, 2020
1 parent 1fd834c commit d919186
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions htf/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def sparse_mapping(molecule_mapping, molecule_mapping_index,
There should be one matrix per molecule.
The ordering of the atoms should follow
what is defined in the output from find_molecules
:param molecule_mapping_index: This is the output from find_molecules.
:param molecule_mapping_index: This is the output from find_molecules.
A list of length L (number of molecules) whose elements are lists of atom indices
:param system: The hoomd system. This is used to get mass values
for the mapping, if you would like to
Expand Down Expand Up @@ -435,11 +435,11 @@ def eds_bias(cv, set_point, period, learning_rate=1, cv_scale=1, name=None):
n = tf.get_variable('{}.n'.format(name), initializer=0, trainable=False)
alpha = tf.get_variable('{}.a'.format(name), initializer=0.0)

reset_mask = tf.cast((n == 0), tf.float32)
reset_mask = tf.cast((n != 0), tf.float32)

# reset statistics if n is 0
reset_mean = mean.assign(mean * reset_mask)
reset_ssd = mean.assign(ssd * reset_mask)
reset_ssd = ssd.assign(ssd * reset_mask)

# update statistics
# do we update? - masked
Expand Down
2 changes: 1 addition & 1 deletion htf/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.0.1'
__version__ = '1.0.2'
3 changes: 2 additions & 1 deletion sphinx-docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
Change Log
==========

v1.0.2 (2020-7-27)
v1.0.2 (2020-?)
-------------------

*Bug fixes*
- EDS Bias was not using mean for computing offset
- EDS Bias was not resetting statistics correctly
- Removed stale test-cc directory that caused cmake errors

v1.0.1 (2020-7-27)
Expand Down

0 comments on commit d919186

Please sign in to comment.