Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Sciencebeam Gym
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sciencebeam
Sciencebeam Gym
Commits
d05fc08e
Commit
d05fc08e
authored
7 years ago
by
Daniel Ecer
Browse files
Options
Downloads
Patches
Plain Diff
removed limited and unnecessary override_if_not_in_args
parent
b0f73db8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sciencebeam_gym/trainer/task.py
+4
-8
4 additions, 8 deletions
sciencebeam_gym/trainer/task.py
sciencebeam_gym/trainer/util.py
+0
-5
0 additions, 5 deletions
sciencebeam_gym/trainer/util.py
with
4 additions
and
13 deletions
sciencebeam_gym/trainer/task.py
+
4
−
8
View file @
d05fc08e
...
...
@@ -22,7 +22,6 @@ from sciencebeam_gym.trainer.evaluator import Evaluator
from
sciencebeam_gym.trainer.util
import
(
CustomSupervisor
,
SimpleStepScheduler
,
override_if_not_in_args
,
get_graph_size
)
...
...
@@ -499,14 +498,17 @@ def run(model, argv):
parser
.
add_argument
(
'
--max_steps
'
,
type
=
int
,
default
=
1000
)
parser
.
add_argument
(
'
--batch_size
'
,
type
=
int
,
default
=
100
,
help
=
'
Number of examples to be processed per mini-batch.
'
)
parser
.
add_argument
(
'
--eval_set_size
'
,
type
=
int
,
help
=
'
Number of examples in the eval set.
'
'
--eval_set_size
'
,
type
=
int
,
default
=
370
,
help
=
'
Number of examples in the eval set.
'
)
parser
.
add_argument
(
'
--qualitative_set_size
'
,
...
...
@@ -690,12 +692,6 @@ def main(_):
model_factory
=
get_model_factory
(
args
.
model
)
model
,
task_args
=
model_factory
.
create_model
(
other_args
)
override_if_not_in_args
(
'
--max_steps
'
,
'
1000
'
,
task_args
)
override_if_not_in_args
(
'
--batch_size
'
,
'
100
'
,
task_args
)
override_if_not_in_args
(
'
--eval_set_size
'
,
'
370
'
,
task_args
)
override_if_not_in_args
(
'
--eval_interval_secs
'
,
'
2
'
,
task_args
)
override_if_not_in_args
(
'
--log_interval_secs
'
,
'
2
'
,
task_args
)
override_if_not_in_args
(
'
--min_train_eval_rate
'
,
'
2
'
,
task_args
)
run
(
model
,
task_args
)
if
__name__
==
'
__main__
'
:
...
...
This diff is collapsed.
Click to expand it.
sciencebeam_gym/trainer/util.py
+
0
−
5
View file @
d05fc08e
...
...
@@ -139,11 +139,6 @@ def read_examples(input_files, shuffle, num_epochs=None):
return
example_id
,
encoded_example
def
override_if_not_in_args
(
flag
,
argument
,
args
):
"""
Checks if flags is in args, and if not it adds the flag to args.
"""
if
flag
not
in
args
:
args
.
extend
([
flag
,
argument
])
def
loss
(
loss_value
):
"""
Calculates aggregated mean loss.
"""
total_loss
=
tf
.
Variable
(
0.0
,
False
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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