Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
Diversified Item Selection Experiments
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
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ananth Mahadevan
Diversified Item Selection Experiments
Commits
1edbeb52
Commit
1edbeb52
authored
5 years ago
by
Ananth Mahadevan
Browse files
Options
Downloads
Patches
Plain Diff
minor formatting
parent
9f7048e3
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
run_adversarial_greedy_exp.py
+9
-7
9 additions, 7 deletions
run_adversarial_greedy_exp.py
with
9 additions
and
7 deletions
run_adversarial_greedy_exp.py
+
9
−
7
View file @
1edbeb52
...
...
@@ -3,9 +3,10 @@ import argparse
from
experiments.adversarial_greedy
import
execute_adversarial_greedy
with
open
(
"
experiments/adversarial_greedy_alg_config.json
"
,
'
r
'
)
as
fp
:
with
open
(
"
experiments/adversarial_greedy_alg_config.json
"
,
"
r
"
)
as
fp
:
alg_dict
=
json
.
load
(
fp
)
def
get_args
():
parser
=
argparse
.
ArgumentParser
(
description
=
"
Collect results for Adversarial example
"
...
...
@@ -14,7 +15,7 @@ def get_args():
"
algorithm
"
,
type
=
str
,
help
=
"
The algorithm to run with adversarial example
"
,
choices
=
alg_dict
.
keys
()
choices
=
alg_dict
.
keys
()
,
)
parser
.
add_argument
(
"
--N
"
,
type
=
int
,
default
=
100
,
help
=
"
Total number of items
"
)
parser
.
add_argument
(
...
...
@@ -29,10 +30,9 @@ def get_args():
type
=
str
,
default
=
"
None
"
,
help
=
"
Whether to overwrite or append results
"
,
choices
=
[
"
None
"
,
"
overwrite
"
,
"
append
"
]
choices
=
[
"
None
"
,
"
overwrite
"
,
"
append
"
]
,
)
args
=
parser
.
parse_args
()
return
args
...
...
@@ -40,5 +40,7 @@ def get_args():
if
__name__
==
"
__main__
"
:
args
=
get_args
()
execute_adversarial_greedy
(
args
,
alg_dict
[
args
.
algorithm
],
overwrite_mode
=
args
.
overwrite_mode
)
execute_adversarial_greedy
(
args
,
alg_dict
[
args
.
algorithm
],
overwrite_mode
=
args
.
overwrite_mode
)
\ No newline at end of file
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