Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NIFTy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Merge Requests
13
Merge Requests
13
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ift
NIFTy
Commits
11387b19
Commit
11387b19
authored
Jul 23, 2018
by
Reimar H Leike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extended model tests to test all models
parent
3f730f24
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
1 deletion
+31
-1
test/test_models/test_model_gradients.py
test/test_models/test_model_gradients.py
+31
-1
No files found.
test/test_models/test_model_gradients.py
View file @
11387b19
...
...
@@ -72,12 +72,14 @@ class Model_Tests(unittest.TestCase):
ift
.
RGSpace
([
32
,
32
],
distances
=
.
789
)],
[
4
,
78
,
23
]
))
def
test
Mul
(
self
,
type1
,
type2
,
space
,
seed
):
def
test
Binary
(
self
,
type1
,
type2
,
space
,
seed
):
model1
=
self
.
make_model
(
type1
,
space_key
=
's1'
,
space
=
space
,
seed
=
seed
)[
's1'
]
model2
=
self
.
make_model
(
type2
,
space_key
=
's2'
,
space
=
space
,
seed
=
seed
+
1
)[
's2'
]
ift
.
extra
.
check_value_gradient_consistency
(
model1
*
model2
)
ift
.
extra
.
check_value_gradient_consistency
(
model1
+
model2
)
ift
.
extra
.
check_value_gradient_consistency
(
model1
*
3.
)
@
expand
(
product
(
[
'Variable'
,
'Constant'
],
...
...
@@ -92,3 +94,31 @@ class Model_Tests(unittest.TestCase):
lin_op
=
self
.
make_linear_operator
(
'ScalingOperator'
,
space
=
space
)
model2
=
self
.
make_model
(
'LinearModel'
,
model
=
model1
,
lin_op
=
lin_op
)
ift
.
extra
.
check_value_gradient_consistency
(
model1
*
model2
)
@
expand
(
product
(
[
'Variable'
,
'Constant'
],
[
ift
.
GLSpace
(
15
),
ift
.
RGSpace
(
64
,
distances
=
.
789
),
ift
.
RGSpace
([
32
,
32
],
distances
=
.
789
)],
[
4
,
78
,
23
]
))
def
testLocalModel
(
self
,
type
,
space
,
seed
):
model
=
self
.
make_model
(
type
,
space_key
=
's'
,
space
=
space
,
seed
=
seed
)[
's'
]
ift
.
extra
.
check_value_gradient_consistency
(
ift
.
PointwiseExponential
(
model
))
ift
.
extra
.
check_value_gradient_consistency
(
ift
.
PointwiseTanh
(
model
))
ift
.
extra
.
check_value_gradient_consistency
(
ift
.
PointwisePositiveTanh
(
model
))
@
expand
(
product
(
[
'Variable'
,
'Constant'
],
[
ift
.
GLSpace
(
15
),
ift
.
RGSpace
(
64
,
distances
=
.
789
),
ift
.
RGSpace
([
32
,
32
],
distances
=
.
789
)],
[
4
,
78
,
23
]
))
def
testMultiModel
(
self
,
type
,
space
,
seed
):
model
=
self
.
make_model
(
type
,
space_key
=
's'
,
space
=
space
,
seed
=
seed
)[
's'
]
mmodel
=
ift
.
MultiModel
(
model
,
'g'
)
ift
.
extra
.
check_value_gradient_consistency
(
mmodel
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment