Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
d90d5280
Unverified
Commit
d90d5280
authored
Jan 22, 2018
by
Neal Wu
Committed by
GitHub
Jan 22, 2018
Browse files
Merge pull request #3206 from cclauss/from-six.moves-import-xrange
from six.moves import xrange (en masse)
parents
6fc65ee6
848cc592
Changes
74
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
20 additions
and
6 deletions
+20
-6
research/brain_coder/common/config_lib.py
research/brain_coder/common/config_lib.py
+1
-0
research/brain_coder/common/schedules_test.py
research/brain_coder/common/schedules_test.py
+1
-0
research/brain_coder/common/utils.py
research/brain_coder/common/utils.py
+1
-0
research/brain_coder/single_task/code_tasks.py
research/brain_coder/single_task/code_tasks.py
+1
-0
research/brain_coder/single_task/ga_lib.py
research/brain_coder/single_task/ga_lib.py
+1
-1
research/brain_coder/single_task/ga_train.py
research/brain_coder/single_task/ga_train.py
+1
-1
research/brain_coder/single_task/pg_agent.py
research/brain_coder/single_task/pg_agent.py
+1
-1
research/brain_coder/single_task/pg_agent_test.py
research/brain_coder/single_task/pg_agent_test.py
+1
-0
research/brain_coder/single_task/results_lib.py
research/brain_coder/single_task/results_lib.py
+1
-1
research/brain_coder/single_task/results_lib_test.py
research/brain_coder/single_task/results_lib_test.py
+1
-0
research/brain_coder/single_task/test_tasks.py
research/brain_coder/single_task/test_tasks.py
+1
-2
research/brain_coder/single_task/tune.py
research/brain_coder/single_task/tune.py
+1
-0
research/compression/entropy_coder/dataset/gen_synthetic_dataset.py
...ompression/entropy_coder/dataset/gen_synthetic_dataset.py
+1
-0
research/compression/entropy_coder/dataset/synthetic_model.py
...arch/compression/entropy_coder/dataset/synthetic_model.py
+1
-0
research/compression/entropy_coder/lib/blocks_masked_conv2d.py
...rch/compression/entropy_coder/lib/blocks_masked_conv2d.py
+1
-0
research/compression/entropy_coder/lib/blocks_masked_conv2d_test.py
...ompression/entropy_coder/lib/blocks_masked_conv2d_test.py
+1
-0
research/compression/entropy_coder/lib/blocks_std_test.py
research/compression/entropy_coder/lib/blocks_std_test.py
+1
-0
research/delf/delf/python/feature_io.py
research/delf/delf/python/feature_io.py
+1
-0
research/differential_privacy/dp_sgd/dp_mnist/dp_mnist.py
research/differential_privacy/dp_sgd/dp_mnist/dp_mnist.py
+1
-0
research/differential_privacy/dp_sgd/per_example_gradients/per_example_gradients.py
...acy/dp_sgd/per_example_gradients/per_example_gradients.py
+1
-0
No files found.
research/brain_coder/common/config_lib.py
View file @
d90d5280
...
@@ -10,6 +10,7 @@ else that may be specific to a particular run.
...
@@ -10,6 +10,7 @@ else that may be specific to a particular run.
import
ast
import
ast
import
itertools
import
itertools
from
six.moves
import
xrange
class
Config
(
dict
):
class
Config
(
dict
):
...
...
research/brain_coder/common/schedules_test.py
View file @
d90d5280
...
@@ -7,6 +7,7 @@ from __future__ import print_function
...
@@ -7,6 +7,7 @@ from __future__ import print_function
from
math
import
exp
from
math
import
exp
from
math
import
sqrt
from
math
import
sqrt
import
numpy
as
np
import
numpy
as
np
from
six.moves
import
xrange
import
tensorflow
as
tf
import
tensorflow
as
tf
from
common
import
config_lib
# brain coder
from
common
import
config_lib
# brain coder
...
...
research/brain_coder/common/utils.py
View file @
d90d5280
...
@@ -12,6 +12,7 @@ import random
...
@@ -12,6 +12,7 @@ import random
from
absl
import
logging
from
absl
import
logging
import
numpy
as
np
import
numpy
as
np
from
six.moves
import
xrange
import
tensorflow
as
tf
import
tensorflow
as
tf
...
...
research/brain_coder/single_task/code_tasks.py
View file @
d90d5280
...
@@ -11,6 +11,7 @@ import random
...
@@ -11,6 +11,7 @@ import random
from
absl
import
logging
from
absl
import
logging
import
numpy
as
np
import
numpy
as
np
from
six.moves
import
xrange
from
common
import
bf
# brain coder
from
common
import
bf
# brain coder
from
common
import
reward
as
r
# brain coder
from
common
import
reward
as
r
# brain coder
...
...
research/brain_coder/single_task/ga_lib.py
View file @
d90d5280
...
@@ -14,6 +14,7 @@ import random
...
@@ -14,6 +14,7 @@ import random
from
absl
import
flags
from
absl
import
flags
from
absl
import
logging
from
absl
import
logging
import
numpy
as
np
import
numpy
as
np
from
six.moves
import
xrange
from
common
import
bf
# brain coder
from
common
import
bf
# brain coder
from
common
import
utils
# brain coder
from
common
import
utils
# brain coder
...
@@ -469,4 +470,3 @@ class Individual(list):
...
@@ -469,4 +470,3 @@ class Individual(list):
def
random_individual
(
genome_size
):
def
random_individual
(
genome_size
):
return
lambda
:
Individual
(
np
.
random
.
choice
(
GENES
,
genome_size
).
tolist
())
return
lambda
:
Individual
(
np
.
random
.
choice
(
GENES
,
genome_size
).
tolist
())
research/brain_coder/single_task/ga_train.py
View file @
d90d5280
...
@@ -18,6 +18,7 @@ from time import sleep
...
@@ -18,6 +18,7 @@ from time import sleep
from
absl
import
flags
from
absl
import
flags
from
absl
import
logging
from
absl
import
logging
import
numpy
as
np
import
numpy
as
np
from
six.moves
import
xrange
import
tensorflow
as
tf
import
tensorflow
as
tf
from
common
import
utils
# brain coder
from
common
import
utils
# brain coder
...
@@ -321,4 +322,3 @@ def run_random_search(max_num_programs, checkpoint_dir, task_eval_fn,
...
@@ -321,4 +322,3 @@ def run_random_search(max_num_programs, checkpoint_dir, task_eval_fn,
solution_found
=
found_solution
,
generations
=
num_programs_seen
,
solution_found
=
found_solution
,
generations
=
num_programs_seen
,
num_programs
=
num_programs_seen
,
max_generations
=
max_num_programs
,
num_programs
=
num_programs_seen
,
max_generations
=
max_num_programs
,
max_num_programs
=
max_num_programs
)
max_num_programs
=
max_num_programs
)
research/brain_coder/single_task/pg_agent.py
View file @
d90d5280
...
@@ -15,6 +15,7 @@ import time
...
@@ -15,6 +15,7 @@ import time
from
absl
import
logging
from
absl
import
logging
import
numpy
as
np
import
numpy
as
np
from
six.moves
import
xrange
import
tensorflow
as
tf
import
tensorflow
as
tf
from
common
import
rollout
as
rollout_lib
# brain coder
from
common
import
rollout
as
rollout_lib
# brain coder
...
@@ -1294,4 +1295,3 @@ def process_episodes(
...
@@ -1294,4 +1295,3 @@ def process_episodes(
batch_targets
=
np
.
array
([],
dtype
=
np
.
float32
)
batch_targets
=
np
.
array
([],
dtype
=
np
.
float32
)
return
(
batch_targets
,
batch_returns
)
return
(
batch_targets
,
batch_returns
)
research/brain_coder/single_task/pg_agent_test.py
View file @
d90d5280
...
@@ -8,6 +8,7 @@ from collections import Counter
...
@@ -8,6 +8,7 @@ from collections import Counter
from
absl
import
logging
from
absl
import
logging
import
numpy
as
np
import
numpy
as
np
from
six.moves
import
xrange
import
tensorflow
as
tf
import
tensorflow
as
tf
from
common
import
utils
# brain coder
from
common
import
utils
# brain coder
...
...
research/brain_coder/single_task/results_lib.py
View file @
d90d5280
...
@@ -8,6 +8,7 @@ import ast
...
@@ -8,6 +8,7 @@ import ast
from
collections
import
namedtuple
from
collections
import
namedtuple
import
os
import
os
import
re
import
re
from
six.moves
import
xrange
import
tensorflow
as
tf
import
tensorflow
as
tf
...
@@ -152,4 +153,3 @@ class Results(object):
...
@@ -152,4 +153,3 @@ class Results(object):
r
for
shard_results
in
results_per_shard
for
r
in
shard_results
]
r
for
shard_results
in
results_per_shard
for
r
in
shard_results
]
return
aggregate
,
shard_stats
return
aggregate
,
shard_stats
research/brain_coder/single_task/results_lib_test.py
View file @
d90d5280
...
@@ -8,6 +8,7 @@ import contextlib
...
@@ -8,6 +8,7 @@ import contextlib
import
os
import
os
import
shutil
import
shutil
import
tempfile
import
tempfile
from
six.moves
import
xrange
import
tensorflow
as
tf
import
tensorflow
as
tf
from
single_task
import
results_lib
# brain coder
from
single_task
import
results_lib
# brain coder
...
...
research/brain_coder/single_task/test_tasks.py
View file @
d90d5280
...
@@ -4,6 +4,7 @@ from __future__ import print_function
...
@@ -4,6 +4,7 @@ from __future__ import print_function
"""Tasks that test correctness of algorithms."""
"""Tasks that test correctness of algorithms."""
from
six.moves
import
xrange
from
common
import
reward
as
reward_lib
# brain coder
from
common
import
reward
as
reward_lib
# brain coder
from
single_task
import
misc
# brain coder
from
single_task
import
misc
# brain coder
...
@@ -124,5 +125,3 @@ class HillClimbingTask(object):
...
@@ -124,5 +125,3 @@ class HillClimbingTask(object):
# closest next element.
# closest next element.
# Maximum distance possible is num_actions * base / 2 = 3 * 8 / 2 = 12
# Maximum distance possible is num_actions * base / 2 = 3 * 8 / 2 = 12
return
(
len
(
prefix
)
+
(
1
-
min_dist
/
12.0
)),
False
return
(
len
(
prefix
)
+
(
1
-
min_dist
/
12.0
)),
False
research/brain_coder/single_task/tune.py
View file @
d90d5280
...
@@ -39,6 +39,7 @@ from absl import app
...
@@ -39,6 +39,7 @@ from absl import app
from
absl
import
flags
from
absl
import
flags
from
absl
import
logging
from
absl
import
logging
import
numpy
as
np
import
numpy
as
np
from
six.moves
import
xrange
import
tensorflow
as
tf
import
tensorflow
as
tf
from
single_task
import
defaults
# brain coder
from
single_task
import
defaults
# brain coder
...
...
research/compression/entropy_coder/dataset/gen_synthetic_dataset.py
View file @
d90d5280
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
import
os
import
os
import
numpy
as
np
import
numpy
as
np
from
six.moves
import
xrange
import
tensorflow
as
tf
import
tensorflow
as
tf
import
synthetic_model
import
synthetic_model
...
...
research/compression/entropy_coder/dataset/synthetic_model.py
View file @
d90d5280
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
"""Binary code sample generator."""
"""Binary code sample generator."""
import
numpy
as
np
import
numpy
as
np
from
six.moves
import
xrange
_CRC_LINE
=
[
_CRC_LINE
=
[
...
...
research/compression/entropy_coder/lib/blocks_masked_conv2d.py
View file @
d90d5280
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
"""Define some typical masked 2D convolutions."""
"""Define some typical masked 2D convolutions."""
import
numpy
as
np
import
numpy
as
np
from
six.moves
import
xrange
import
tensorflow
as
tf
import
tensorflow
as
tf
import
block_util
import
block_util
...
...
research/compression/entropy_coder/lib/blocks_masked_conv2d_test.py
View file @
d90d5280
...
@@ -19,6 +19,7 @@ from __future__ import division
...
@@ -19,6 +19,7 @@ from __future__ import division
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
import
numpy
as
np
import
numpy
as
np
from
six.moves
import
xrange
import
tensorflow
as
tf
import
tensorflow
as
tf
import
blocks_masked_conv2d
import
blocks_masked_conv2d
...
...
research/compression/entropy_coder/lib/blocks_std_test.py
View file @
d90d5280
...
@@ -22,6 +22,7 @@ import math
...
@@ -22,6 +22,7 @@ import math
import
os
import
os
import
numpy
as
np
import
numpy
as
np
from
six.moves
import
xrange
import
tensorflow
as
tf
import
tensorflow
as
tf
import
blocks_std
import
blocks_std
...
...
research/delf/delf/python/feature_io.py
View file @
d90d5280
...
@@ -25,6 +25,7 @@ from __future__ import print_function
...
@@ -25,6 +25,7 @@ from __future__ import print_function
from
delf
import
feature_pb2
from
delf
import
feature_pb2
from
delf
import
datum_io
from
delf
import
datum_io
import
numpy
as
np
import
numpy
as
np
from
six.moves
import
xrange
import
tensorflow
as
tf
import
tensorflow
as
tf
...
...
research/differential_privacy/dp_sgd/dp_mnist/dp_mnist.py
View file @
d90d5280
...
@@ -22,6 +22,7 @@ import sys
...
@@ -22,6 +22,7 @@ import sys
import
time
import
time
import
numpy
as
np
import
numpy
as
np
from
six.moves
import
xrange
import
tensorflow
as
tf
import
tensorflow
as
tf
from
differential_privacy.dp_sgd.dp_optimizer
import
dp_optimizer
from
differential_privacy.dp_sgd.dp_optimizer
import
dp_optimizer
...
...
research/differential_privacy/dp_sgd/per_example_gradients/per_example_gradients.py
View file @
d90d5280
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
import
collections
import
collections
from
six.moves
import
xrange
import
tensorflow
as
tf
import
tensorflow
as
tf
OrderedDict
=
collections
.
OrderedDict
OrderedDict
=
collections
.
OrderedDict
...
...
Prev
1
2
3
4
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment