kernel-elastic-autoencoder 3.3.3__tar.gz → 3.3.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {kernel_elastic_autoencoder-3.3.3 → kernel_elastic_autoencoder-3.3.5}/PKG-INFO +1 -1
- {kernel_elastic_autoencoder-3.3.3 → kernel_elastic_autoencoder-3.3.5}/pyproject.toml +1 -1
- {kernel_elastic_autoencoder-3.3.3 → kernel_elastic_autoencoder-3.3.5}/src/kernel_elastic_autoencoder/config.py +1 -1
- {kernel_elastic_autoencoder-3.3.3 → kernel_elastic_autoencoder-3.3.5}/src/kernel_elastic_autoencoder/model.py +1 -1
- {kernel_elastic_autoencoder-3.3.3 → kernel_elastic_autoencoder-3.3.5}/src/kernel_elastic_autoencoder/training.py +4 -4
- {kernel_elastic_autoencoder-3.3.3 → kernel_elastic_autoencoder-3.3.5}/README.md +0 -0
- {kernel_elastic_autoencoder-3.3.3 → kernel_elastic_autoencoder-3.3.5}/src/kernel_elastic_autoencoder/__init__.py +0 -0
- {kernel_elastic_autoencoder-3.3.3 → kernel_elastic_autoencoder-3.3.5}/src/kernel_elastic_autoencoder/layers.py +0 -0
- {kernel_elastic_autoencoder-3.3.3 → kernel_elastic_autoencoder-3.3.5}/src/kernel_elastic_autoencoder/losses.py +0 -0
- {kernel_elastic_autoencoder-3.3.3 → kernel_elastic_autoencoder-3.3.5}/src/kernel_elastic_autoencoder/pipeline.py +0 -0
- {kernel_elastic_autoencoder-3.3.3 → kernel_elastic_autoencoder-3.3.5}/src/kernel_elastic_autoencoder/tokenizer.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "kernel_elastic_autoencoder"
|
|
3
|
-
version = "3.3.
|
|
3
|
+
version = "3.3.5"
|
|
4
4
|
description = "Implementation of Kernel-Elastic Autoencoder for Molecular Design (https://doi.org/10.1093/pnasnexus/pgae168)"
|
|
5
5
|
authors = [
|
|
6
6
|
{ name = "Felix Rotter-McCartney", email = "felix.rotter@mail.utoronto.ca" }
|
|
@@ -58,7 +58,7 @@ class ModelInputConfig(Config):
|
|
|
58
58
|
description="Vocabulary size of tokenizer. Should be fetched with Tokenizer.vocab_size as specified in the "
|
|
59
59
|
"Tokenizer Protocol.",
|
|
60
60
|
)
|
|
61
|
-
condition_channels:
|
|
61
|
+
condition_channels: NonNegativeInt = Field(
|
|
62
62
|
default=2,
|
|
63
63
|
description="Number of condition channels, should correspond to number of numerical columns in your "
|
|
64
64
|
"dataset/inputs.",
|
|
@@ -128,11 +128,11 @@ class Trainer:
|
|
|
128
128
|
dataloader_train, desc=f"Epoch {epoch}, Train Batch"
|
|
129
129
|
):
|
|
130
130
|
optimizer.zero_grad()
|
|
131
|
-
prediction, prediction_noise,
|
|
131
|
+
prediction, prediction_noise, latents = model(
|
|
132
132
|
input_ids, conditions, token_mask, condition_mask
|
|
133
133
|
)
|
|
134
134
|
loss = loss_fn(
|
|
135
|
-
prediction, prediction_noise, input_ids[:, 1:],
|
|
135
|
+
prediction, prediction_noise, input_ids[:, 1:], latents
|
|
136
136
|
)
|
|
137
137
|
accelerator.backward(loss)
|
|
138
138
|
optimizer.step()
|
|
@@ -145,14 +145,14 @@ class Trainer:
|
|
|
145
145
|
dataloader_test, desc=f"Epoch {epoch}, Test Batch"
|
|
146
146
|
):
|
|
147
147
|
with torch.no_grad():
|
|
148
|
-
prediction, prediction_noise,
|
|
148
|
+
prediction, prediction_noise, latents = model(
|
|
149
149
|
input_ids,
|
|
150
150
|
conditions,
|
|
151
151
|
token_mask,
|
|
152
152
|
condition_mask,
|
|
153
153
|
)
|
|
154
154
|
loss = loss_fn(
|
|
155
|
-
prediction, prediction_noise, input_ids[:, 1:],
|
|
155
|
+
prediction, prediction_noise, input_ids[:, 1:], latents
|
|
156
156
|
)
|
|
157
157
|
test_loss = torch.cat([test_loss, loss.detach().unsqueeze(-1)], dim=0)
|
|
158
158
|
accelerator.print(f"Avg. test loss: {test_loss.mean().item()}")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|