Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MLAir
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esde
machine-learning
MLAir
Commits
d4849364
Commit
d4849364
authored
5 years ago
by
lukas leufen
Browse files
Options
Downloads
Patches
Plain Diff
updated tests
parent
df8e3cba
Branches
Branches containing commit
Tags
Tags containing commit
3 merge requests
!90
WIP: new release update
,
!89
Resolve "release branch / CI on gpu"
,
!73
Resolve "lr_decay should be optional"
Pipeline
#31877
passed
5 years ago
Stage: test
Stage: pages
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/test_modules/test_model_setup.py
+14
-1
14 additions, 1 deletion
test/test_modules/test_model_setup.py
with
14 additions
and
1 deletion
test/test_modules/test_model_setup.py
+
14
−
1
View file @
d4849364
...
@@ -4,6 +4,7 @@ import pytest
...
@@ -4,6 +4,7 @@ import pytest
from
src.data_handling.data_generator
import
DataGenerator
from
src.data_handling.data_generator
import
DataGenerator
from
src.datastore
import
EmptyScope
from
src.datastore
import
EmptyScope
from
src.model_modules.keras_extensions
import
CallbackHandler
from
src.model_modules.model_class
import
AbstractModelClass
from
src.model_modules.model_class
import
AbstractModelClass
from
src.run_modules.model_setup
import
ModelSetup
from
src.run_modules.model_setup
import
ModelSetup
from
src.run_modules.run_environment
import
RunEnvironment
from
src.run_modules.run_environment
import
RunEnvironment
...
@@ -61,6 +62,18 @@ class TestModelSetup:
...
@@ -61,6 +62,18 @@ class TestModelSetup:
setup
.
checkpoint_name
=
"
TestName
"
setup
.
checkpoint_name
=
"
TestName
"
setup
.
_set_callbacks
()
setup
.
_set_callbacks
()
assert
"
general.modeltest
"
in
setup
.
data_store
.
search_name
(
"
callbacks
"
)
assert
"
general.modeltest
"
in
setup
.
data_store
.
search_name
(
"
callbacks
"
)
callbacks
=
setup
.
data_store
.
get
(
"
callbacks
"
,
"
general.modeltest
"
)
assert
len
(
callbacks
.
get_callbacks
())
==
3
def
test_set_callbacks_no_lr_decay
(
self
,
setup
):
setup
.
data_store
.
set
(
"
lr_decay
"
,
None
,
"
general.model
"
)
assert
"
general.modeltest
"
not
in
setup
.
data_store
.
search_name
(
"
callbacks
"
)
setup
.
checkpoint_name
=
"
TestName
"
setup
.
_set_callbacks
()
callbacks
:
CallbackHandler
=
setup
.
data_store
.
get
(
"
callbacks
"
,
"
general.modeltest
"
)
assert
len
(
callbacks
.
get_callbacks
())
==
2
with
pytest
.
raises
(
IndexError
):
callbacks
.
get_callback_by_name
(
"
lr_decay
"
)
def
test_get_model_settings
(
self
,
setup_with_model
):
def
test_get_model_settings
(
self
,
setup_with_model
):
with
pytest
.
raises
(
EmptyScope
):
with
pytest
.
raises
(
EmptyScope
):
...
@@ -73,7 +86,7 @@ class TestModelSetup:
...
@@ -73,7 +86,7 @@ class TestModelSetup:
setup_with_gen
.
build_model
()
setup_with_gen
.
build_model
()
assert
isinstance
(
setup_with_gen
.
model
,
AbstractModelClass
)
assert
isinstance
(
setup_with_gen
.
model
,
AbstractModelClass
)
expected
=
{
"
window_history_size
"
,
"
window_lead_time
"
,
"
channels
"
,
"
dropout_rate
"
,
"
regularizer
"
,
"
initial_lr
"
,
expected
=
{
"
window_history_size
"
,
"
window_lead_time
"
,
"
channels
"
,
"
dropout_rate
"
,
"
regularizer
"
,
"
initial_lr
"
,
"
optimizer
"
,
"
lr_decay
"
,
"
epochs
"
,
"
batch_size
"
,
"
activation
"
}
"
optimizer
"
,
"
epochs
"
,
"
batch_size
"
,
"
activation
"
}
assert
expected
<=
self
.
current_scope_as_set
(
setup_with_gen
)
assert
expected
<=
self
.
current_scope_as_set
(
setup_with_gen
)
def
test_set_channels
(
self
,
setup_with_gen_tiny
):
def
test_set_channels
(
self
,
setup_with_gen_tiny
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment