Skip to content
This repository was archived by the owner on Oct 14, 2025. It is now read-only.
This repository was archived by the owner on Oct 14, 2025. It is now read-only.

Implement ISST on top of BAOAB using external python code for weight calculation #16

@FrederikHeber

Description

@FrederikHeber

The sampler code in, e.g., src/TATi/samplers/baoabsampler.py adds nodes to the graph to perform a single sampling step for each of the parameter matrices. TATi creates two parameter matrices per layer, one weight matrix and one bias vector.
Assume we have a single hidden layer and one input and one output layer, then we have in total four sets of matrices for which sampling step nodes are added: weights and biases of the hidden layer, weights and biases of the output layer.

As the ISST weights are constant per step and hold for all parameters, the calculation of the weights (i.e. evaluating two integrals) needs to occur outside of the sampler code.

As a first step, the weight calculation can be implemented in python code without using tensorflow nodes directly. To this end, the following should be added:

  • Python function that calculates the ISST weights and returns the force rescaling parameter (and adds the weights to ordered list)
  • It is possible that numerically stable summation is required due to exponential factors in integrands: sum negative and positive contributions in separate ordered/sorted lists from smallest to largest magnitude
  • Add a new tf.placeholder in src/TATi/neuralnetwork.py's add_sample_method() for the force rescaling parameter
  • Create a new infiniteswitchsimulatedtemperingsampler.py in src/TATi/samplers copying baoabsampler.py which obtains a new tf.placeholder in it's constructor that contains the force rescaling.
  • Extend the loop over current_step in src/TATi/model/model.py's sample():
    • gather weights in ordered/sorted lists (as arguments to python function for force rescaling)
    • add force rescaling parameter to feed_dict using the new placeholder
  • For debugging either add tf.summary.scalar(..) or tf.summary.histogram(..). Alternatively use tf.Print(..) to output nodes on evaluation.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions