pyprobound.rounds.InitialRound
- class InitialRound(name='')
Bases:
BaseRoundInitial sequenced round, outputs 1 by convention.
- __init__(name='')
Initializes the round.
- Parameters:
name (
str) – A string used to describe the round.
Methods
cache(fun)Decorator for a function to cache its output.
check_length_consistency()Checks that input lengths of Binding components are consistent.
Iterator of child components.
forward(seqs)Predicts the log relative count.
freeze()Turns off gradient calculation for all parameters.
log_aggregate(seqs)Predicts the log aggregate \(\log Z_i\).
log_cumulative_enrichment(seqs)Predicts the log cumulative enrichment.
log_enrichment(seqs)Predicts the log enrichment ratio.
max_embedding_size()The maximum number of bytes needed to encode a sequence.
optim_procedure([ancestry, current_order])The sequential optimization procedure for all Binding components.
reload(checkpoint)Loads the model from a checkpoint file.
reload_from_state_dict(state_dict)Loads the model from a state dict.
save(checkpoint[, flank_lengths])Saves the model to a file with "state_dict" and "metadata" fields.
unfreeze([parameter])Turns on gradient calculation for the specified parameter.
Attributes
library_concentrationThe total library concentration \([\text{library}]\).
unfreezablealias of
Literal['all', 'depth']Non-Inherited Members
- log_aggregate(seqs)
Predicts the log aggregate \(\log Z_i\).
- Parameters:
seqs (
Tensor) – A sequence tensor of shape \((\text{minibatch},\text{length})\) or \((\text{minibatch},\text{in_channels},\text{length})\).- Return type:
Tensor- Returns:
The log aggregate tensor of shape \((\text{minibatch},)\).
- log_enrichment(seqs)
Predicts the log enrichment ratio.
\[\log \frac{f_{i,r}}{f_{i,r-1}}\]- Parameters:
seqs (
Tensor) – A sequence tensor of shape \((\text{minibatch},\text{length})\) or \((\text{minibatch},\text{in_channels},\text{length})\).- Return type:
Tensor- Returns:
The log enrichment ratio tensor of shape \((\text{minibatch},)\).