Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate with nnfabrik #2

Merged
merged 45 commits into from
Feb 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
cfc2863
Initial commit
christoph-blessing Jan 17, 2020
0f8987c
Initial commit
christoph-blessing Jan 17, 2020
dcb2c6b
Strip output
christoph-blessing Jan 17, 2020
ec8ac82
Ignore data and .ssh directories
christoph-blessing Jan 29, 2020
8d32400
Ignore data folder
christoph-blessing Jan 29, 2020
3e358a6
Use two-stage build to clone private repositories
christoph-blessing Jan 29, 2020
e4d2f7c
Make sure key file has the correct permissions
christoph-blessing Jan 31, 2020
e8e6053
Fix not being able to import nnfabrik and mlutils
christoph-blessing Jan 31, 2020
51c9f95
Initial commit
christoph-blessing Jan 31, 2020
afb8e93
Ignore .idea/
christoph-blessing Jan 31, 2020
933a28e
Mount ./data directory in /data
christoph-blessing Feb 4, 2020
0edc517
Install JupyterLab extension that enables vim keybindings
christoph-blessing Feb 4, 2020
a8c69fc
Add datajoint and nnfabrik as requirements
christoph-blessing Feb 4, 2020
9d4ad15
Implement CSRFV1SelectorTemplate
christoph-blessing Feb 4, 2020
8b76cee
Merge branch 'master' of github.com:sinzlab/mei
christoph-blessing Feb 4, 2020
9b1e5fa
Convert definition property to class attribute
christoph-blessing Feb 4, 2020
c5fa6b0
Implement MEIMethod table
christoph-blessing Feb 4, 2020
f2a6311
Rename method in CSRFV1SelectorTemplate
christoph-blessing Feb 5, 2020
42ea6d0
Add comment to MEIMethod table definition
christoph-blessing Feb 5, 2020
e5f3d68
Change some attribute names in MEIMethod table
christoph-blessing Feb 5, 2020
805483d
Store session id in Selector table
christoph-blessing Feb 6, 2020
f8785df
Change how the output is selected in the Selector table
christoph-blessing Feb 6, 2020
08ea632
Implement MEI table template
christoph-blessing Feb 6, 2020
27abc0d
Move mei method loading logic from MEI template to MEIMethod table
christoph-blessing Feb 7, 2020
cd915b3
Resolve function names when loading mei method
christoph-blessing Feb 7, 2020
e7633eb
Simplify make Method in MEITemplate
christoph-blessing Feb 7, 2020
ee7a4a1
Save function evaluations in MEI table
christoph-blessing Feb 7, 2020
5c87387
Move code that inserts mei to separate method
christoph-blessing Feb 7, 2020
10b273e
Improve some minor things
christoph-blessing Feb 7, 2020
435ed08
Move code that determines the input shape to separate method
christoph-blessing Feb 7, 2020
9e55498
Update base docker image
christoph-blessing Feb 10, 2020
ad22723
Change port for CPU container
christoph-blessing Feb 10, 2020
adb33e5
Save MEI as a numpy array and not as a tensor
christoph-blessing Feb 10, 2020
6e6ac9a
Implement TrainedEnsembleModel table
christoph-blessing Feb 10, 2020
f7382c5
Save mei as a torch tensor
christoph-blessing Feb 10, 2020
c6cc8de
Squeeze MEI before insertion
christoph-blessing Feb 10, 2020
637ea8b
Update docstring of MEITemplate
christoph-blessing Feb 10, 2020
aa3c3dd
Add comments to TrainedEnsembleModelTemplate table definitions
christoph-blessing Feb 10, 2020
302ee39
Add more docstrings
christoph-blessing Feb 11, 2020
f4584c9
Reorder classes
christoph-blessing Feb 11, 2020
6c801a6
Make it such that user does not have to subclass Member table
christoph-blessing Feb 13, 2020
0bafcf8
Demonstrate mei integration with nnfabrik
christoph-blessing Feb 13, 2020
fe8095f
Blacken cells
christoph-blessing Feb 13, 2020
0a03e1c
Make MEITemplate unaware of neuron_id
christoph-blessing Feb 13, 2020
68a1fdc
Move gradient ascent logic to MEIMethod table
christoph-blessing Feb 13, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
data
133 changes: 133 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

data/
.ssh/
.idea/
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM sinzlab/pytorch:v3.8-torch1.4.0-cuda10.1-dj0.12.4 as intermediate

WORKDIR /
COPY .ssh/id_rsa .
# Need to change the permissions of the private key because otherwise they are too open if the key is copied from
# Windows
RUN chmod 400 id_rsa && \
eval $(ssh-agent) && \
ssh-add id_rsa && \
ssh-keyscan -H github.com >> /etc/ssh/ssh_known_hosts && \
git clone git@github.com:sinzlab/nnfabrik /src/nnfabrik && \
git clone git@github.com:sinzlab/ml-utils /src/ml-utils



FROM sinzlab/pytorch:v3.8-torch1.4.0-cuda10.1-dj0.12.4

COPY --from=intermediate /src /src
WORKDIR /src
RUN python3 -m pip install ./nnfabrik && \
python3 -m pip install ./ml-utils

RUN apt-get update && apt-get install -y nodejs npm
RUN jupyter labextension install jupyterlab_vim

WORKDIR /src/mei
COPY . .
RUN python3 -m pip install -e .
1,105 changes: 121 additions & 984 deletions Examples.ipynb

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: "3.7"
services:
pycharm:
build: .
volumes:
- .:/src/mei
- ./data:/data
entrypoint: ""
jupyter:
build: .
volumes:
- .:/src/mei
- ./data:/data
ports:
- 8888:8888
env_file:
- .env
28 changes: 28 additions & 0 deletions docker-compose.yml.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{% set common %}
build: .
volumes:
- .:/src/mei
- ./data:/data
env_file:
- .env
ipc: host
{% endset %}

version: '2.3'
services:
{% for i in range(N_GPU) %}
gpu{{ i }}:
{{ common|indent(4, True) }}
ports:
- 1004{{ i }}:8888
container_name: "dev_cblessing_mei_gpu{{ i }}"
environment:
- NVIDIA_VISIBLE_DEVICES={{ i }}
runtime: nvidia
{% endfor %}
cpu:
{{ common|indent(4, True) }}
ports:
- 10051:8888
container_name: "dev_cblessing_mei_cpu"
runtime: runc
Loading