-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
626e61b
commit cd77001
Showing
2 changed files
with
44 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
tests/end_to_end_tests/test_toy_lightning_train_session.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import os | ||
from functools import partial | ||
|
||
from qusi.internal.light_curve_dataset import ( | ||
default_light_curve_observation_post_injection_transform, | ||
) | ||
from qusi.internal.single_dense_layer_model import SingleDenseLayerBinaryClassificationModel | ||
from qusi.internal.toy_light_curve_collection import get_toy_dataset | ||
from qusi.internal.train_hyperparameter_configuration import TrainHyperparameterConfiguration | ||
from qusi.internal.lightning_train_session import train_session | ||
|
||
|
||
def test_toy_train_session(): | ||
os.environ["WANDB_MODE"] = "disabled" | ||
model = SingleDenseLayerBinaryClassificationModel.new(input_size=100) | ||
dataset = get_toy_dataset() | ||
dataset.post_injection_transform = partial( | ||
default_light_curve_observation_post_injection_transform, length=100 | ||
) | ||
train_hyperparameter_configuration = TrainHyperparameterConfiguration.new( | ||
batch_size=3, cycles=2, train_steps_per_cycle=5, validation_steps_per_cycle=5 | ||
) | ||
train_session( | ||
train_datasets=[dataset], | ||
validation_datasets=[dataset], | ||
model=model, | ||
hyperparameter_configuration=train_hyperparameter_configuration, | ||
) |