Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
KerasROOTClassification
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
Nikolai.Hartmann
KerasROOTClassification
Commits
a3ed26cf
Commit
a3ed26cf
authored
6 years ago
by
Nikolai
Browse files
Options
Downloads
Patches
Plain Diff
getters and setters for more datasets
parent
fa38a43d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
toolkit.py
+26
-4
26 additions, 4 deletions
toolkit.py
with
26 additions
and
4 deletions
toolkit.py
+
26
−
4
View file @
a3ed26cf
...
...
@@ -100,10 +100,13 @@ class KerasROOTClassification(object):
self
.
b_train
=
None
self
.
s_test
=
None
self
.
b_test
=
None
self
.
x_train
=
None
self
.
x_test
=
None
self
.
y_train
=
None
self
.
y_test
=
None
self
.
_x_train
=
None
self
.
_x_test
=
None
self
.
_y_train
=
None
self
.
_y_test
=
None
self
.
_w_train
=
None
self
.
_w_test
=
None
self
.
s_eventlist_train
=
None
self
.
b_eventlist_train
=
None
...
...
@@ -560,6 +563,25 @@ class KerasROOTClassification(object):
plt
.
savefig
(
os
.
path
.
join
(
self
.
project_dir
,
"
accuracy.pdf
"
))
plt
.
clf
()
def
create_getter
(
dataset_name
):
def
getx
(
self
):
if
getattr
(
self
,
"
_
"
+
dataset_name
)
is
None
:
self
.
_load_from_hdf5
([
dataset_name
])
return
getattr
(
self
,
"
_
"
+
dataset_name
)
return
getx
def
create_setter
(
dataset_name
):
def
setx
(
self
,
value
):
# maybe change this at some point to also dump into hdf
setattr
(
self
,
"
_
"
+
dataset_name
,
value
)
return
setx
# define getters and setters for all datasets
for
dataset_name
in
KerasROOTClassification
.
dataset_names
:
setattr
(
KerasROOTClassification
,
dataset_name
,
property
(
create_getter
(
dataset_name
),
create_setter
(
dataset_name
)))
if
__name__
==
"
__main__
"
:
logging
.
basicConfig
()
...
...
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