Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.learn.pytorch
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
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
bob
bob.learn.pytorch
Commits
4fa5fa92
Commit
4fa5fa92
authored
6 years ago
by
Guillaume HEUSCH
Browse files
Options
Downloads
Patches
Plain Diff
[script] remove the get_parameter function from the train_cnn script
parent
fb36d05c
No related branches found
No related tags found
1 merge request
!4
Resolve "Add GANs"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/learn/pytorch/scripts/train_cnn.py
+0
-42
0 additions, 42 deletions
bob/learn/pytorch/scripts/train_cnn.py
with
0 additions
and
42 deletions
bob/learn/pytorch/scripts/train_cnn.py
+
0
−
42
View file @
4fa5fa92
...
...
@@ -52,48 +52,6 @@ from bob.learn.pytorch.utils import get_parameter
version
=
pkg_resources
.
require
(
'
bob.learn.pytorch
'
)[
0
].
version
def
get_parameter
(
args
,
configuration
,
keyword
,
default
):
"""
Get the right value for a parameter
The parameters are either defined in a separate configuration file
or given directly via command-line. Note that the command-line
has priority over the configuration file.
As a convention, parameters made with more than one word (i.e. batch size)
are provided with an underscore in the configuration file, and with an
hyphen in the command-line:
- configuration: batch_size=64
- command line: --batch-size=64
Parameters
----------
args: dictionary
The arguments as parsed from the command line.
configuration: object
The arguments given by the configuration file.
keyword: string
the keyword for the parameter to process (in the
"
configuration
"
style)
default:
The default value of the parameter
Returns
-------
arg:
The right value for the given keyword argument
"""
args_kw
=
'
--
'
+
keyword
.
replace
(
'
_
'
,
'
-
'
)
_type
=
type
(
default
)
arg
=
_type
(
args
[
args_kw
])
if
hasattr
(
configuration
,
keyword
):
arg
=
getattr
(
configuration
,
keyword
)
if
_type
(
args
[
args_kw
])
is
not
default
:
arg
=
_type
(
args
[
args_kw
])
return
arg
def
main
(
user_input
=
None
):
# Parse the command-line arguments
...
...
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