Skip to content
Permalink
Browse files

isort -y -sp tox.ini

  • Loading branch information...
ppwwyyxx committed Dec 22, 2018
1 parent 9c2be2a commit ac9ac2a436fcdf566d8675938a8bcb7e1c8baf1c
Showing with 724 additions and 795 deletions.
  1. +1 −1 README.md
  2. +5 −7 examples/A3C-Gym/simulator.py
  3. +8 −11 examples/A3C-Gym/train-atari.py
  4. +5 −5 examples/CTC-TIMIT/create-lmdb.py
  5. +2 −1 examples/CTC-TIMIT/timitdata.py
  6. +4 −4 examples/CTC-TIMIT/train-timit.py
  7. +4 −4 examples/CaffeModels/load-alexnet.py
  8. +3 −2 examples/CaffeModels/load-cpm.py
  9. +3 −3 examples/CaffeModels/load-vgg16.py
  10. +3 −3 examples/CaffeModels/load-vgg19.py
  11. +4 −5 examples/Char-RNN/char-rnn.py
  12. +6 −6 examples/DeepQNetwork/DQN.py
  13. +3 −3 examples/DeepQNetwork/DQNModel.py
  14. +7 −8 examples/DeepQNetwork/atari.py
  15. +0 −1 examples/DeepQNetwork/atari_wrapper.py
  16. +3 −3 examples/DeepQNetwork/common.py
  17. +5 −5 examples/DeepQNetwork/expreplay.py
  18. +5 −5 examples/DisturbLabel/mnist-disturb.py
  19. +2 −3 examples/DisturbLabel/svhn-disturb.py
  20. +5 −7 examples/DoReFa-Net/alexnet-dorefa.py
  21. +1 −0 examples/DoReFa-Net/dorefa.py
  22. +3 −3 examples/DoReFa-Net/resnet-dorefa.py
  23. +2 −2 examples/DoReFa-Net/svhn-digit-dorefa.py
  24. +4 −5 examples/DynamicFilterNetwork/steering-filter.py
  25. +2 −3 examples/FasterRCNN/basemodel.py
  26. +3 −4 examples/FasterRCNN/coco.py
  27. +1 −0 examples/FasterRCNN/config.py
  28. +10 −11 examples/FasterRCNN/data.py
  29. +7 −8 examples/FasterRCNN/eval.py
  30. +3 −3 examples/FasterRCNN/model_cascade.py
  31. +7 −8 examples/FasterRCNN/model_fpn.py
  32. +4 −5 examples/FasterRCNN/model_frcnn.py
  33. +3 −4 examples/FasterRCNN/model_mrcnn.py
  34. +4 −5 examples/FasterRCNN/model_rpn.py
  35. +26 −39 examples/FasterRCNN/train.py
  36. +2 −0 examples/FasterRCNN/utils/box_ops.py
  37. +7 −16 examples/FasterRCNN/utils/generate_anchors.py
  38. +2 −2 examples/FasterRCNN/viz.py
  39. +4 −3 examples/GAN/BEGAN.py
  40. +6 −6 examples/GAN/ConditionalGAN-mnist.py
  41. +5 −5 examples/GAN/CycleGAN.py
  42. +5 −5 examples/GAN/DCGAN.py
  43. +6 −6 examples/GAN/DiscoGAN-CelebA.py
  44. +4 −4 examples/GAN/GAN.py
  45. +8 −8 examples/GAN/Image2Image.py
  46. +4 −3 examples/GAN/Improved-WGAN.py
  47. +8 −8 examples/GAN/InfoGAN-mnist.py
  48. +4 −2 examples/GAN/WGAN.py
  49. +5 −6 examples/HED/hed.py
  50. +1 −2 examples/ImageNetModels/alexnet.py
  51. +8 −10 examples/ImageNetModels/imagenet_utils.py
  52. +1 −2 examples/ImageNetModels/inception-bn.py
  53. +3 −7 examples/ImageNetModels/shufflenet.py
  54. +1 −3 examples/ImageNetModels/vgg16.py
  55. +3 −3 examples/OpticalFlow/flownet2.py
  56. +1 −0 examples/OpticalFlow/flownet_models.py
  57. +4 −5 examples/PennTreebank/PTB-LSTM.py
  58. +1 −5 examples/PennTreebank/reader.py
  59. +2 −2 examples/ResNet/cifar10-preact18-mixup.py
  60. +2 −4 examples/ResNet/cifar10-resnet.py
  61. +6 −10 examples/ResNet/imagenet-resnet.py
  62. +7 −7 examples/ResNet/load-resnet.py
  63. +1 −2 examples/ResNet/resnet_model.py
  64. +9 −13 examples/Saliency/CAM-resnet.py
  65. +2 −3 examples/Saliency/saliency-maps.py
  66. +2 −1 examples/SimilarityLearning/embedding_data.py
  67. +2 −3 examples/SimilarityLearning/mnist-embeddings.py
  68. +4 −5 examples/SpatialTransformer/mnist-addition.py
  69. +4 −3 examples/SuperResolution/data_sampler.py
  70. +6 −6 examples/SuperResolution/enet-pat.py
  71. +3 −2 examples/basics/cifar-convnet.py
  72. +1 −0 examples/basics/export-model.py
  73. +5 −6 examples/basics/mnist-convnet.py
  74. +5 −6 examples/basics/mnist-tflayers.py
  75. +3 −2 examples/basics/mnist-tfslim.py
  76. +1 −0 examples/basics/mnist-visualizations.py
  77. +2 −2 examples/basics/svhn-digit-convnet.py
  78. +1 −1 examples/boilerplate.py
  79. +6 −7 examples/keras/imagenet-resnet-keras.py
  80. +4 −6 examples/keras/mnist-keras-v2.py
  81. +6 −6 examples/keras/mnist-keras.py
  82. +2 −2 scripts/checkpoint-manipulate.py
  83. +4 −3 scripts/checkpoint-prof.py
  84. +2 −2 scripts/dump-model-params.py
  85. +3 −3 scripts/ls-checkpoint.py
  86. +3 −3 setup.py
  87. +2 −1 tensorpack/callbacks/base.py
  88. +3 −2 tensorpack/callbacks/concurrency.py
  89. +3 −3 tensorpack/callbacks/graph.py
  90. +4 −4 tensorpack/callbacks/group.py
  91. +1 −0 tensorpack/callbacks/hooks.py
  92. +3 −3 tensorpack/callbacks/inference.py
  93. +6 −11 tensorpack/callbacks/inference_runner.py
  94. +3 −3 tensorpack/callbacks/misc.py
  95. +7 −7 tensorpack/callbacks/monitor.py
  96. +6 −6 tensorpack/callbacks/param.py
  97. +5 −5 tensorpack/callbacks/prof.py
  98. +3 −3 tensorpack/callbacks/saver.py
  99. +2 −2 tensorpack/callbacks/stats.py
  100. +3 −4 tensorpack/callbacks/steps.py
  101. +1 −1 tensorpack/callbacks/summary.py
  102. +1 −1 tensorpack/callbacks/trigger.py
  103. +10 −14 tensorpack/contrib/keras.py
  104. +2 −1 tensorpack/dataflow/base.py
  105. +8 −8 tensorpack/dataflow/common.py
  106. +1 −1 tensorpack/dataflow/dataset/bsds500.py
  107. +1 −1 tensorpack/dataflow/dataset/cifar.py
  108. +2 −2 tensorpack/dataflow/dataset/ilsvrc.py
  109. +1 −1 tensorpack/dataflow/dataset/mnist.py
  110. +2 −2 tensorpack/dataflow/dataset/svhn.py
  111. +1 −3 tensorpack/dataflow/dftools.py
  112. +8 −7 tensorpack/dataflow/format.py
  113. +4 −3 tensorpack/dataflow/image.py
  114. +3 −3 tensorpack/dataflow/imgaug/_test.py
  115. +2 −2 tensorpack/dataflow/imgaug/base.py
  116. +3 −2 tensorpack/dataflow/imgaug/convert.py
  117. +1 −2 tensorpack/dataflow/imgaug/crop.py
  118. +3 −2 tensorpack/dataflow/imgaug/deform.py
  119. +0 −1 tensorpack/dataflow/imgaug/external.py
  120. +1 −1 tensorpack/dataflow/imgaug/geometry.py
  121. +2 −1 tensorpack/dataflow/imgaug/imgproc.py
  122. +1 −1 tensorpack/dataflow/imgaug/misc.py
  123. +2 −1 tensorpack/dataflow/imgaug/noise.py
  124. +3 −3 tensorpack/dataflow/imgaug/paste.py
  125. +3 −3 tensorpack/dataflow/imgaug/transform.py
  126. +12 −14 tensorpack/dataflow/parallel.py
  127. +8 −12 tensorpack/dataflow/parallel_map.py
  128. +2 −1 tensorpack/dataflow/raw.py
  129. +4 −4 tensorpack/dataflow/remote.py
  130. +6 −7 tensorpack/dataflow/serialize.py
  131. +4 −7 tensorpack/graph_builder/distributed.py
  132. +2 −2 tensorpack/graph_builder/model_desc.py
  133. +1 −1 tensorpack/graph_builder/predict.py
  134. +10 −13 tensorpack/graph_builder/training.py
  135. +4 −5 tensorpack/graph_builder/utils.py
  136. +13 −12 tensorpack/input_source/input_source.py
  137. +4 −4 tensorpack/input_source/input_source_base.py
  138. +6 −4 tensorpack/models/_old_batch_norm.py
  139. +1 −1 tensorpack/models/_test.py
  140. +6 −6 tensorpack/models/batch_norm.py
  141. +2 −2 tensorpack/models/common.py
  142. +6 −5 tensorpack/models/conv2d.py
  143. +3 −3 tensorpack/models/fc.py
  144. +2 −1 tensorpack/models/layer_norm.py
  145. +2 −1 tensorpack/models/linearwrap.py
  146. +1 −1 tensorpack/models/nonlin.py
  147. +4 −5 tensorpack/models/pool.py
  148. +3 −3 tensorpack/models/registry.py
  149. +3 −3 tensorpack/models/regularize.py
  150. +1 −0 tensorpack/models/shapes.py
  151. +3 −3 tensorpack/models/tflayer.py
  152. +3 −3 tensorpack/predict/base.py
  153. +5 −5 tensorpack/predict/concurrency.py
  154. +2 −2 tensorpack/predict/config.py
  155. +5 −6 tensorpack/predict/dataset.py
  156. +3 −4 tensorpack/predict/feedfree.py
  157. +2 −1 tensorpack/predict/multigpu.py
  158. +4 −4 tensorpack/tfutils/argscope.py
  159. +2 −2 tensorpack/tfutils/collection.py
  160. +1 −0 tensorpack/tfutils/common.py
  161. +1 −0 tensorpack/tfutils/dependency.py
  162. +2 −2 tensorpack/tfutils/export.py
  163. +5 −4 tensorpack/tfutils/gradproc.py
  164. +1 −1 tensorpack/tfutils/model_utils.py
  165. +2 −2 tensorpack/tfutils/optimizer.py
  166. +1 −1 tensorpack/tfutils/scope_utils.py
  167. +2 −1 tensorpack/tfutils/sesscreate.py
  168. +2 −3 tensorpack/tfutils/sessinit.py
  169. +4 −5 tensorpack/tfutils/summary.py
  170. +3 −3 tensorpack/tfutils/tower.py
  171. +3 −2 tensorpack/tfutils/varmanip.py
  172. +1 −1 tensorpack/tfutils/varreplace.py
  173. +12 −14 tensorpack/train/base.py
  174. +4 −6 tensorpack/train/config.py
  175. +1 −4 tensorpack/train/interface.py
  176. +6 −8 tensorpack/train/tower.py
  177. +11 −16 tensorpack/train/trainers.py
  178. +1 −3 tensorpack/train/utility.py
  179. +2 −0 tensorpack/utils/argtools.py
  180. +2 −1 tensorpack/utils/compatible_serialize.py
  181. +4 −4 tensorpack/utils/concurrency.py
  182. +2 −2 tensorpack/utils/develop.py
  183. +3 −2 tensorpack/utils/fs.py
  184. +3 −2 tensorpack/utils/gpu.py
  185. +4 −4 tensorpack/utils/loadcaffe.py
  186. +3 −3 tensorpack/utils/logger.py
  187. +1 −3 tensorpack/utils/nvml.py
  188. +1 −0 tensorpack/utils/rect.py
  189. +3 −2 tensorpack/utils/serialize.py
  190. +4 −4 tensorpack/utils/timer.py
  191. +2 −3 tensorpack/utils/utils.py
  192. +3 −2 tensorpack/utils/viz.py
  193. +1 −6 tests/run-tests.sh
  194. +2 −1 tests/test_char_rnn.py
  195. +1 −0 tests/test_infogan.py
  196. +5 −4 tests/test_serializer.py
  197. +10 −0 tox.ini
@@ -32,7 +32,7 @@ It's Yet Another TF high-level API, with __speed__, and __flexibility__ built to

See [tutorials and documentations](http://tensorpack.readthedocs.io/tutorial/index.html#user-tutorials) to know more about these features.

## [Examples](examples):
## Examples:

We refuse toy examples.
Instead of showing you 10 arbitrary networks trained on toy datasets,
@@ -4,20 +4,18 @@
# Author: Yuxin Wu

import multiprocessing as mp
import time
import os
import threading
from abc import abstractmethod, ABCMeta
import time
from abc import ABCMeta, abstractmethod
from collections import defaultdict

import six
from six.moves import queue
import zmq
from six.moves import queue

from tensorpack.utils import logger
from tensorpack.utils.serialize import loads, dumps
from tensorpack.utils.concurrency import (
LoopThread, ensure_proc_terminate, enable_death_signal)
from tensorpack.utils.concurrency import LoopThread, enable_death_signal, ensure_proc_terminate
from tensorpack.utils.serialize import dumps, loads

__all__ = ['SimulatorProcess', 'SimulatorMaster',
'SimulatorProcessStateExchange',
@@ -3,29 +3,26 @@
# File: train-atari.py
# Author: Yuxin Wu

import argparse
import numpy as np
import sys
import os
import sys
import uuid
import argparse

import cv2
import tensorflow as tf
import gym
import six
import tensorflow as tf
from six.moves import queue


from tensorpack import *
from tensorpack.utils.concurrency import ensure_proc_terminate, start_proc_mask_signal
from tensorpack.utils.serialize import dumps
from tensorpack.tfutils.gradproc import MapGradient, SummaryGradient
from tensorpack.utils.concurrency import ensure_proc_terminate, start_proc_mask_signal
from tensorpack.utils.gpu import get_num_gpu
from tensorpack.utils.serialize import dumps


import gym
from simulator import SimulatorProcess, SimulatorMaster, TransitionExperience
from atari_wrapper import FireResetEnv, FrameStack, LimitLength, MapState
from common import Evaluator, eval_model_multithread, play_n_episodes
from atari_wrapper import MapState, FrameStack, FireResetEnv, LimitLength
from simulator import SimulatorMaster, SimulatorProcess, TransitionExperience

if six.PY3:
from concurrent import futures
@@ -2,17 +2,17 @@
# -*- coding: utf-8 -*-
# File: create-lmdb.py
# Author: Yuxin Wu
import argparse
import numpy as np
import os
import scipy.io.wavfile as wavfile
import string
import numpy as np
import argparse

import bob.ap
import scipy.io.wavfile as wavfile

from tensorpack.dataflow import DataFlow, LMDBSerializer
from tensorpack.utils import fs, logger, serialize
from tensorpack.utils.argtools import memoized
from tensorpack.utils.stats import OnlineMoments
from tensorpack.utils import serialize, fs, logger
from tensorpack.utils.utils import get_tqdm

CHARSET = set(string.ascii_lowercase + ' ')
@@ -2,10 +2,11 @@
# File: timitdata.py
# Author: Yuxin Wu

from tensorpack import ProxyDataFlow
import numpy as np
from six.moves import range

from tensorpack import ProxyDataFlow

__all__ = ['TIMITBatch']


@@ -3,17 +3,17 @@
# File: train-timit.py
# Author: Yuxin Wu

import os
import argparse
import os
import tensorflow as tf
from six.moves import range


from tensorpack import *
from tensorpack.tfutils.gradproc import SummaryGradient, GlobalNormClip
from tensorpack.tfutils.gradproc import GlobalNormClip, SummaryGradient
from tensorpack.utils import serialize
import tensorflow as tf

from timitdata import TIMITBatch

rnn = tf.contrib.rnn


@@ -4,16 +4,16 @@
# Author: Yuxin Wu

from __future__ import print_function
import argparse
import numpy as np
import os
import cv2
import argparse
import tensorflow as tf

from tensorpack import *
from tensorpack.tfutils.symbolic_functions import *
from tensorpack.tfutils.summary import *
from tensorpack.dataflow.dataset import ILSVRCMeta
import tensorflow as tf
from tensorpack.tfutils.summary import *
from tensorpack.tfutils.symbolic_functions import *


def tower_func(image):
@@ -3,15 +3,16 @@
# File: load-cpm.py
# Author: Yuxin Wu

import argparse
import numpy as np
import cv2
import tensorflow as tf
import numpy as np
import argparse

from tensorpack import *
from tensorpack.utils import viz
from tensorpack.utils.argtools import memoized


"""
15 channels:
0-1 head, neck
@@ -3,12 +3,12 @@
# File: load-vgg16.py

from __future__ import print_function
import cv2
import tensorflow as tf
import argparse
import numpy as np
import os
import cv2
import six
import argparse
import tensorflow as tf

from tensorpack import *
from tensorpack.dataflow.dataset import ILSVRCMeta
@@ -3,12 +3,12 @@
# File: load-vgg19.py

from __future__ import print_function
import cv2
import tensorflow as tf
import argparse
import numpy as np
import os
import cv2
import six
import argparse
import tensorflow as tf

from tensorpack import *
from tensorpack.dataflow.dataset import ILSVRCMeta
@@ -3,21 +3,20 @@
# File: char-rnn.py
# Author: Yuxin Wu

import argparse
import numpy as np
import operator
import os
import sys
import argparse
from collections import Counter
import operator
import six
import tensorflow as tf
from six.moves import range


from tensorpack import *
from tensorpack.tfutils import summary, optimizer
from tensorpack.tfutils import optimizer, summary
from tensorpack.tfutils.gradproc import GlobalNormClip

import tensorflow as tf
rnn = tf.contrib.rnn

class _NS: pass # noqa
@@ -3,20 +3,20 @@
# File: DQN.py
# Author: Yuxin Wu

import os
import argparse
import cv2
import numpy as np
import tensorflow as tf
import os
import cv2
import gym
import tensorflow as tf

from tensorpack import *

from DQNModel import Model as DQNModel
from atari import AtariPlayer
from atari_wrapper import FireResetEnv, FrameStack, LimitLength, MapState
from common import Evaluator, eval_model_multithread, play_n_episodes
from atari_wrapper import FrameStack, MapState, FireResetEnv, LimitLength
from DQNModel import Model as DQNModel
from expreplay import ExpReplay
from atari import AtariPlayer

BATCH_SIZE = 64
IMAGE_SIZE = (84, 84)
@@ -4,11 +4,11 @@

import abc
import tensorflow as tf

from tensorpack import ModelDesc
from tensorpack.utils import logger
from tensorpack.tfutils import (
varreplace, summary, get_current_tower_context, optimizer, gradproc)
from tensorpack.tfutils import get_current_tower_context, gradproc, optimizer, summary, varreplace
from tensorpack.tfutils.scope_utils import auto_reuse_variable_scope
from tensorpack.utils import logger


class Model(ModelDesc):
@@ -4,19 +4,18 @@

import numpy as np
import os
import cv2
import threading
import six
from six.moves import range
from tensorpack.utils import logger
from tensorpack.utils.utils import get_rng, execute_only_once
from tensorpack.utils.fs import get_dataset_path

import cv2
import gym
import six
from ale_python_interface import ALEInterface
from gym import spaces
from gym.envs.atari.atari_env import ACTION_MEANING
from six.moves import range

from ale_python_interface import ALEInterface
from tensorpack.utils import logger
from tensorpack.utils.fs import get_dataset_path
from tensorpack.utils.utils import execute_only_once, get_rng

__all__ = ['AtariPlayer']

@@ -3,7 +3,6 @@

import numpy as np
from collections import deque

import gym
from gym import spaces

@@ -1,15 +1,15 @@
# -*- coding: utf-8 -*-
# File: common.py
# Author: Yuxin Wu
import multiprocessing
import random
import time
import multiprocessing
from tqdm import tqdm
from six.moves import queue
from tqdm import tqdm

from tensorpack.utils.concurrency import StoppableThread, ShareSessionThread
from tensorpack.callbacks import Callback
from tensorpack.utils import logger
from tensorpack.utils.concurrency import ShareSessionThread, StoppableThread
from tensorpack.utils.stats import StatCounter
from tensorpack.utils.utils import get_tqdm_kwargs

@@ -2,18 +2,18 @@
# File: expreplay.py
# Author: Yuxin Wu

import numpy as np
import copy
from collections import deque, namedtuple
import numpy as np
import threading
from collections import deque, namedtuple
from six.moves import queue, range

from tensorpack.callbacks.base import Callback
from tensorpack.dataflow import DataFlow
from tensorpack.utils import logger
from tensorpack.utils.utils import get_tqdm, get_rng
from tensorpack.utils.stats import StatCounter
from tensorpack.utils.concurrency import LoopThread, ShareSessionThread
from tensorpack.callbacks.base import Callback
from tensorpack.utils.stats import StatCounter
from tensorpack.utils.utils import get_rng, get_tqdm

__all__ = ['ExpReplay']

@@ -2,17 +2,17 @@
# -*- coding: utf-8 -*-
# File: mnist-disturb.py

import os
import argparse

import imp
import os
import tensorflow as tf

from tensorpack import *
from tensorpack.utils import logger
from tensorpack.dataflow import dataset
import tensorflow as tf
from tensorpack.utils import logger

from disturb import DisturbLabel

import imp
mnist_example = imp.load_source('mnist_example',
os.path.join(os.path.dirname(__file__), '..', 'basics', 'mnist-convnet.py'))
get_config = mnist_example.get_config
@@ -3,13 +3,12 @@
# File: svhn-disturb.py

import argparse
import os
import imp

import os

from tensorpack import *
from tensorpack.utils import logger
from tensorpack.dataflow import dataset
from tensorpack.utils import logger

from disturb import DisturbLabel

Oops, something went wrong.

0 comments on commit ac9ac2a

Please sign in to comment.
You can’t perform that action at this time.