Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/state/configs/model/state.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ kwargs:
nb_decoder: False
mask_attn: False
use_effect_gating_token: False
zero_perturbation_encoder: False
distributional_loss: energy
init_from: null
transformer_backbone_key: llama
Expand Down
1 change: 1 addition & 0 deletions src/state/configs/model/state_lg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ kwargs:
nb_decoder: False
mask_attn: False
use_effect_gating_token: False
zero_perturbation_encoder: False
use_basal_projection: False
distributional_loss: energy
init_from: null
Expand Down
1 change: 1 addition & 0 deletions src/state/configs/model/state_sm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ kwargs:
nb_decoder: False
mask_attn: False
use_effect_gating_token: False
zero_perturbation_encoder: False
use_basal_projection: False
distributional_loss: energy
gene_decoder_bool: False
Expand Down
3 changes: 3 additions & 0 deletions src/state/tx/models/state_transition.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ def __init__(
raise ValueError(f"Unknown loss function: {loss_name}")

self.use_basal_projection = kwargs.get("use_basal_projection", True)
self.zero_perturbation_encoder = kwargs.get("zero_perturbation_encoder", False)

# Build the underlying neural OT network
self._build_networks(lora_cfg=kwargs.get("lora", None))
Expand Down Expand Up @@ -392,6 +393,8 @@ def forward(self, batch: dict, padded=True) -> torch.Tensor:

# Shape: [B, S, input_dim]
pert_embedding = self.encode_perturbation(pert)
if self.zero_perturbation_encoder:
pert_embedding = torch.zeros_like(pert_embedding)
control_cells = self.encode_basal_expression(basal)

# Add encodings in input_dim space, then project to hidden_dim
Expand Down