Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
FreeForestML
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CERN
fsauerbu
FreeForestML
Commits
4b9f72b7
Unverified
Commit
4b9f72b7
authored
5 years ago
by
Frank Sauerburger
Browse files
Options
Downloads
Patches
Plain Diff
Draft HepNet class
parent
3c949c92
Branches
59-add-systematic-band-stack
Branches containing commit
No related tags found
1 merge request
!5
Resolve "Implement Meta Model"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
nnfwtbn/model.py
+14
-21
14 additions, 21 deletions
nnfwtbn/model.py
with
14 additions
and
21 deletions
nnfwtbn/model.py
+
14
−
21
View file @
4b9f72b7
...
...
@@ -32,8 +32,6 @@ class CrossValidator(ABC):
# Handle variable
if
isinstance
(
self
.
variable
,
str
):
self
.
variable
=
Variable
(
self
.
variable
,
self
.
variable
)
@abstractmethod
def
select_slice
(
self
,
df
,
slice_id
):
...
...
@@ -202,33 +200,28 @@ class HepNet:
Creates a new HEP model. The keras model parameter is a callable that
returns a new instance of the model (The HEP net needs to able to create
multiple models, one for each cross validation fold.)
"""
def
set
(
self
,
key
,
value
):
"""
Stores properties such as normalization moments.
"""
The cross_validator must be a CrossValidator object.
def
get
(
self
,
key
,
value
):
"""
Returns properties such as
normalization
momen
ts.
The normalizor must be a callable that returns a normalizor. Each
cross_validation fold uses a separate normalizor with independent
normalization
weigh
ts.
"""
self
.
model
=
keras_model
self
.
cv
=
cross_validator
self
.
norm
=
normalizor
def
store
(
self
,
file
):
"""
Write properties and training weights to the given file.
"""
def
restore
(
self
,
file
):
"""
Loads properties and training weights from the given file.
"""
def
fit
(
self
,
df
,
selection
):
"""
Calls fit() on
the Keras model
Calls fit() on
all folds.
"""
### Loop over folds:
# seed normalizors
# fit folds
def
predict
(
self
,
df
):
"""
Calls predict() on the Keras model
...
...
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