|
QDpy
|
Learn a multi-objective conditional sampler with trajectory balance. More...
Public Member Functions | |
| stats (self) | |
| fit (self, preferences, *, updates, batch_size=64) | |
| Train on complete paths under supplied preferences. | |
| sample (self, preference, *, size=1) | |
| Generate new terminal objects without reward evaluations. | |
| distribution (self, preference) | |
| Sum learned path probabilities reaching each terminal. | |
| target_distribution (self, preference) | |
| Enumerate the normalized target for a small graph. | |
| illuminate (self, archive, evaluate, preferences, *, budget) | |
| Fill a native QD archive with measured GFlowNet proposals. | |
Learn a multi-objective conditional sampler with trajectory balance.
Train on a small named DAG with a fixed uniform backward policy. The terminal target is proportional to (preference.dot(positive_objectives)) ** reward_power. The forward network and trajectory normalizer both receive the preference. Terminal objectives are cached across trajectories and audits. Import PyTorch only when a sampler is constructed. :param graph: ConstructiveDAG containing the legal transitions. :param reward: Callback (terminal) returning the positive objective vector. :param objectives: Length of the objective and preference vectors. :param hidden_size: Width of the state embeddings and hidden layers. :param reward_power: Temper the terminal reward with this positive power. :param learning_rate: Adam step size. :param exploration: Probability of a uniform transition during training. :param seed: Private seed for network initialization and sampling.
Definition at line 87 of file gflownet.py.
| qdpy.algorithms.gflownet.PreferenceGFlowNet.distribution | ( | self, | |
| preference ) |
Sum learned path probabilities reaching each terminal.
Return exact terminal probabilities of the current forward policy.
Definition at line 240 of file gflownet.py.
| qdpy.algorithms.gflownet.PreferenceGFlowNet.fit | ( | self, | |
| preferences, | |||
| * | , | ||
| updates, | |||
| batch_size = 64 ) |
Train on complete paths under supplied preferences.
Draw preferences uniformly from the supplied panel and train on sampled paths.
Definition at line 208 of file gflownet.py.
| qdpy.algorithms.gflownet.PreferenceGFlowNet.illuminate | ( | self, | |
| archive, | |||
| evaluate, | |||
| preferences, | |||
| * | , | ||
| budget ) |
Fill a native QD archive with measured GFlowNet proposals.
Evaluate budget samples for (scalar fitness, descriptors) or None. Cycle preferences in the given order. Archive measurements are independent of the training reward cache. Supply a parentless best-only Grid or CVTGrid, optionally populated.
Definition at line 267 of file gflownet.py.
| qdpy.algorithms.gflownet.PreferenceGFlowNet.sample | ( | self, | |
| preference, | |||
| * | , | ||
| size = 1 ) |
Generate new terminal objects without reward evaluations.
Return a tuple sampled from the learned policy under one preference.
Definition at line 232 of file gflownet.py.
| qdpy.algorithms.gflownet.PreferenceGFlowNet.stats | ( | self | ) |
Return the current training and audit work counters.
Definition at line 149 of file gflownet.py.
| qdpy.algorithms.gflownet.PreferenceGFlowNet.target_distribution | ( | self, | |
| preference ) |
Enumerate the normalized target for a small graph.
Measure previously unseen terminal rewards and return the desired probabilities.
Definition at line 258 of file gflownet.py.