Skip to content
This repository was archived by the owner on Jul 7, 2023. It is now read-only.

Commit 7967b44

Browse files
cwbeitelrsepassi
authored andcommitted
img2img_allen_brain problem defs (#872)
* img2img_allen_brain problem defs only outstanding issue blocking this should be that the test in allen_brain_test.py that uses tf.eager breaks many/all other t2t tests not compatible with eager mode. squashed these: commit 76c8cd3f105c07919f84d70b02b1fbd38b5376fe Author: cwbeitel <me@cwbeitel-github.com> Date: Fri Jun 15 18:35:13 2018 +0000 fix mock_raw_data commit f0dc3a0 Merge: 3e17473 4b7360d Author: cwbeitel <me@cwbeitel-github.com> Date: Thu Jun 14 22:54:33 2018 +0000 Merge branch 'allen-deps' of https://github.com/cwbeitel/tensor2tensor into allen-deps commit 3e17473 Author: cwbeitel <me@cwbeitel-github.com> Date: Fri Jun 8 17:04:39 2018 +0000 cleanup commit 3e8ef9d Author: cwbeitel <me@cwbeitel-github.com> Date: Wed Jun 6 23:07:28 2018 +0000 removed image summary writing from metrics training was 10x slower than CIFAR img2img problem, profiled and found 91% of time was being sp ent writing ImageSummary's, removed that from metrics and saw the speed increase as expected. commit 4814556 Author: cwbeitel <me@cwbeitel-github.com> Date: Tue May 29 16:00:17 2018 +0000 basic img2img prob. defs that maybe get data commit 320f06c Author: cwbeitel <me@cwbeitel-github.com> Date: Thu May 24 18:53:02 2018 +0000 test without accessing network, follow rcfile * made test that accesses remote API optional, off by default * included test that runs sub-image extractor on mocked raw input image within mocked directory structure mirroring what would be produced by running actual data downloader * refactoring according to rcfile commit 503123b Author: cwbeitel <me@cwbeitel-github.com> Date: Wed May 23 22:09:31 2018 +0000 add [allen] deps to travis setup commit 239188b Author: cwbeitel <me@cwbeitel-github.com> Date: Wed May 23 21:39:13 2018 +0000 data download and sub-image gen utility * if additional [allen] deps not present suggest running `pip install tensor2tensor[allen]` * obtains a list of section dataset ID's from Allen Institute API * downloads specified number of raw images from specified number of section datasets * produces specified number of sub-images of specified size from raw images. * simple e2e test that runs the data downloader and sub-image generator with default parameters commit af34cc6 Author: cwbeitel <me@cwbeitel-github.com> Date: Wed May 23 17:47:35 2018 +0000 deps. for allen brain img probs. via extras * run allen tests separately on ci * travis debug * include previously excluded setup.py that defines [allen] step * smaller e2e test, maybe addresses travis OOM * linter fixes * Remove allensdk dependency; various improvements * Simplify allen_brain_utils* to download smaller static list of images, avoiding allensdk dependency. * Simplify _generator given input is already in [0, 255] * _generator ignores likely non-tissue/background regions based on max intensity * Fractional in-painting step added to pre-processor, depends on inpaint_fraction property, randomly positioned square region * Random crop to target dimensions instead of downsampling leaving full resolution of target intact * Re-using same generated data for different problems that share examples (differing in terms of how these are pre-processed) * cleanup
1 parent 7b532bd commit 7967b44

File tree

7 files changed

+807
-1
lines changed

7 files changed

+807
-1
lines changed

.travis.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ install:
4242
- pip install -q .
4343
- t2t-trainer --registry_help
4444
# Then install the test dependencies
45-
- pip install -q .[tests]
45+
- pip install -q .[tests,allen]
4646
# Make sure to install the atari extras for gym
4747
- pip install "gym[atari]"
4848
# Make sure we have the latest version of numpy - avoid problems we were
@@ -59,6 +59,8 @@ script:
5959
# * trainer_lib_test
6060
# * visualization_test
6161
# * model_rl_experiment_test
62+
# * allen_brain_test
63+
# * allen_brain_utils_test
6264
# * model_rl_experiment_stochastic_test
6365
# * models/research
6466
# algorithmic_math_test: flaky
@@ -71,11 +73,15 @@ script:
7173
--ignore=tensor2tensor/data_generators/algorithmic_math_test.py
7274
--ignore=tensor2tensor/models/research/universal_transformer_test.py
7375
--ignore=tensor2tensor/rl/model_rl_experiment_test.py
76+
--ignore=tensor2tensor/data_generators/allen_brain_test.py
77+
--ignore=tensor2tensor/data_generators/allen_brain_utils_test.py
7478
--ignore=tensor2tensor/rl/model_rl_experiment_stochastic_test.py
7579
--ignore=tensor2tensor/models/research
7680
- pytest tensor2tensor/utils/registry_test.py
7781
- pytest tensor2tensor/utils/trainer_lib_test.py
7882
- pytest tensor2tensor/visualization/visualization_test.py
83+
- pytest tensor2tensor/data_generators/allen_brain_test.py
84+
- pytest tensor2tensor/data_generators/allen_brain_utils_test.py
7985
- if [[ "$TF_VERSION" == "$TF_LATEST" ]] || [[ "$TF_VERSION" == "tf-nightly" ]];
8086
then
8187
pytest tensor2tensor/models/research;

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
# explicit pip install gym[atari] for the tests.
5959
# 'gym[atari]',
6060
],
61+
'allen': ['Pillow==5.1.0', 'pandas==0.23.0']
6162
},
6263
classifiers=[
6364
'Development Status :: 4 - Beta',

tensor2tensor/data_generators/all_problems.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
MODULES = [
2424
"tensor2tensor.data_generators.algorithmic",
2525
"tensor2tensor.data_generators.algorithmic_math",
26+
"tensor2tensor.data_generators.allen_brain",
2627
"tensor2tensor.data_generators.audio",
2728
"tensor2tensor.data_generators.babi_qa",
2829
"tensor2tensor.data_generators.bair_robot_pushing",

0 commit comments

Comments
 (0)