Skip to content
This repository has been archived by the owner on Aug 18, 2023. It is now read-only.

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
zaqqwerty committed Feb 15, 2022
1 parent b5d1666 commit 0657d17
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions qhbmlib/energy_infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ def __init__(self,
list(itertools.product([0, 1], repeat=input_energy.num_bits)),
dtype=tf.int8)
self._logits_variable = tf.Variable(
-1.0 * input_energy(self.all_bitstrings), trainable=False)
-input_energy(self.all_bitstrings), trainable=False)
self._distribution = tfd.Categorical(logits=self._logits_variable)

@property
Expand All @@ -418,7 +418,7 @@ def distribution(self):

def _ready_inference(self):
"""See base class docstring."""
self._logits_variable.assign(-1.0 * self.all_energies)
self._logits_variable.assign(-self.all_energies)

def _call(self, inputs, *args, **kwargs):
"""See base class docstring."""
Expand Down Expand Up @@ -505,7 +505,7 @@ def _log_partition_forward_pass(self):
"""
thetas = 0.5 * self.energy.logits
single_log_partitions = tf.math.log(
tf.math.exp(thetas) + tf.math.exp(-1.0 * thetas))
tf.math.exp(thetas) + tf.math.exp(-thetas))
return tf.math.reduce_sum(single_log_partitions)

def _sample(self, num_samples: int):
Expand Down

0 comments on commit 0657d17

Please sign in to comment.