kernel-elastic-autoencoder 3.2.5__tar.gz → 3.3.1__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.2.5 → kernel_elastic_autoencoder-3.3.1}/PKG-INFO +1 -1
- {kernel_elastic_autoencoder-3.2.5 → kernel_elastic_autoencoder-3.3.1}/pyproject.toml +1 -1
- {kernel_elastic_autoencoder-3.2.5 → kernel_elastic_autoencoder-3.3.1}/src/kernel_elastic_autoencoder/training.py +7 -4
- {kernel_elastic_autoencoder-3.2.5 → kernel_elastic_autoencoder-3.3.1}/README.md +0 -0
- {kernel_elastic_autoencoder-3.2.5 → kernel_elastic_autoencoder-3.3.1}/src/kernel_elastic_autoencoder/__init__.py +0 -0
- {kernel_elastic_autoencoder-3.2.5 → kernel_elastic_autoencoder-3.3.1}/src/kernel_elastic_autoencoder/config.py +0 -0
- {kernel_elastic_autoencoder-3.2.5 → kernel_elastic_autoencoder-3.3.1}/src/kernel_elastic_autoencoder/layers.py +0 -0
- {kernel_elastic_autoencoder-3.2.5 → kernel_elastic_autoencoder-3.3.1}/src/kernel_elastic_autoencoder/losses.py +0 -0
- {kernel_elastic_autoencoder-3.2.5 → kernel_elastic_autoencoder-3.3.1}/src/kernel_elastic_autoencoder/model.py +0 -0
- {kernel_elastic_autoencoder-3.2.5 → kernel_elastic_autoencoder-3.3.1}/src/kernel_elastic_autoencoder/pipeline.py +0 -0
- {kernel_elastic_autoencoder-3.2.5 → kernel_elastic_autoencoder-3.3.1}/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
|
+
version = "3.3.1"
|
|
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" }
|
|
@@ -104,14 +104,13 @@ class Trainer:
|
|
|
104
104
|
)
|
|
105
105
|
curr_epoch = 0
|
|
106
106
|
|
|
107
|
-
model, optimizer, dataloader_train, dataloader_test, scheduler,
|
|
107
|
+
model, optimizer, dataloader_train, dataloader_test, scheduler, loss_fn = (
|
|
108
108
|
accelerator.prepare(
|
|
109
109
|
model,
|
|
110
110
|
optimizer,
|
|
111
111
|
dataloader_train,
|
|
112
112
|
dataloader_test,
|
|
113
113
|
scheduler,
|
|
114
|
-
curr_epoch,
|
|
115
114
|
loss_fn,
|
|
116
115
|
)
|
|
117
116
|
)
|
|
@@ -124,6 +123,7 @@ class Trainer:
|
|
|
124
123
|
accelerator.wait_for_everyone()
|
|
125
124
|
for epoch in range(curr_epoch, self.config_typed.common.max_epochs):
|
|
126
125
|
model.train()
|
|
126
|
+
train_loss = torch.tensor([], device=accelerator.device)
|
|
127
127
|
for input_ids, conditions, token_mask, condition_mask in tqdm(
|
|
128
128
|
dataloader_train, desc=f"Epoch {epoch}, Train Batch"
|
|
129
129
|
):
|
|
@@ -136,9 +136,11 @@ class Trainer:
|
|
|
136
136
|
)
|
|
137
137
|
accelerator.backward(loss)
|
|
138
138
|
optimizer.step()
|
|
139
|
-
|
|
139
|
+
torch.cat([train_loss, loss.detach()], dim=0)
|
|
140
|
+
accelerator.print(f"Avg. train loss: {train_loss.mean().item()}")
|
|
140
141
|
|
|
141
142
|
model.eval()
|
|
143
|
+
test_loss = torch.tensor([], device=accelerator.device)
|
|
142
144
|
for input_ids, conditions, token_mask, condition_mask in tqdm(
|
|
143
145
|
dataloader_test, desc=f"Epoch {epoch}, Test Batch"
|
|
144
146
|
):
|
|
@@ -152,7 +154,8 @@ class Trainer:
|
|
|
152
154
|
loss = loss_fn(
|
|
153
155
|
prediction, prediction_noise, input_ids[:, 1:], latents_noise
|
|
154
156
|
)
|
|
155
|
-
|
|
157
|
+
torch.cat([test_loss, loss.detach()], dim=0)
|
|
158
|
+
accelerator.print(f"Avg. test loss: {test_loss.mean().item()}")
|
|
156
159
|
|
|
157
160
|
scheduler.step()
|
|
158
161
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|