Skip to content

Commit

Permalink
move project to DeepCodebase template
Browse files Browse the repository at this point in the history
  • Loading branch information
hughplay committed Jan 6, 2023
1 parent 69d448c commit 531cb97
Show file tree
Hide file tree
Showing 223 changed files with 28,978 additions and 9,135 deletions.
156 changes: 144 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,148 @@
# Workspace
.DS_Store
# Project
.vscode/
**/*.bak/
**/*.bak
train_log/
log/
data/
conf/local/default.yaml
.zsh_history

# Python
.ipynb_checkpoints/
# Byte-compiled / optimized / DLL files
__pycache__/
*.pyc
*.py[cod]
*$py.class

# Data
data/*
!data/gen_src/
data/gen_src/blender_app/
# C extensions
*.so

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

# PyInstaller
# Usually these files are written by a python script from a templates
# 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/
cover/

# 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
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .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/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# vim
*.swp
66 changes: 66 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Pre-commit: https://pre-commit.com/
# Git hook scripts are useful for identifying simple issues before submission to
# code review.
#
#
# Quick Start
# 1. Install pre-commit:
# pip install pre-commit
# 2. Install git hook scripts, and pre-commit will run automatically on git commit:
# pre-commit install
# 3. (optional) Run against all the files
# pre-commit run -a
# 4. git commit and pre-commit will run automatically
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
# list of supported hooks: https://pre-commit.com/hooks.html
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
args: ["--maxkb=1000"]
- id: check-case-conflict
- id: debug-statements
- id: detect-private-key

# python code formatting
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
args: [--line-length, "80"]

# python import sorting
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]

# python docstring formatting
- repo: https://github.com/myint/docformatter
rev: v1.4
hooks:
- id: docformatter
args: [--in-place, --wrap-summaries, "80", --wrap-descriptions, "80"]

# yaml formatting
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.5.1
hooks:
- id: prettier
types: [yaml]

# python code analysis
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8

# jupyter notebook cell output clearing
# - repo: https://github.com/kynan/nbstripout
# rev: 0.5.0
# hooks:
# - id: nbstripout
60 changes: 60 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Changelog

## TODO



## Currently Working On

- [x] merge tvr and real tvr to DeepCodebase Framework.
- [x] dataset
- [x] evaluation
- [x] pipeline
- [x] config
- [x] test old models.
- start: 2022-12-16 22:40:11
- fix bug: add view_idx to inputs
- [x] dataset size ablation
- [x] reinforce ablation
- no better validation accuracy, but train acc keeps increasing, which means overfitting
- adamw seems to be more stable, lr=0.0005 is better for now
- try:
- [x] fix encoder, only tune classifier and decoder
- better than previous tunning, but still not better than baseline
- [x] rnn dropout
- 0.3 is best
- [x] classifier dropout
- 0.3 is best
- [x] test half precision
- no speed up, weird
- [x] add transformer based model
- [ ] other scripts
- [ ] preprocess
- copy properties.json and values.json to /data/trance
- ~~reading h5py is faster than reading raw images for training, but not much, only seconds for each epoch~~, previous code has bug
- speed is nearly the same, I believe data reading is not the bottleneck
- [ ] gen_rc
- change primary models from concat to subtract
- [ ] reinforce ablation
- [ ] scaling data ablation

Issues:

- [x] on node 12, `RuntimeError: cuDNN error: CUDNN_STATUS_EXECUTION_FAILED` when running `python core.py train config/event.ConcatResNet.yaml`.
- move the whole code into DeepCodebase and run in docker.
- [x] training is slow.
- the training stops on 4th iteration in 1st epoch.
- seems to be caused by profiler
- find the bottleneck through profiler
- learn profilers
- pytorch profiler: https://pytorch.org/tutorials/recipes/recipes/profiler_recipe.html
- open json files in chrome://tracing
- nvprof: https://docs.nvidia.com/cuda/profiler-users-guide/index.html
- the bottleneck is shown to be ReasonCriterion
- tried to show exact modules in the criterion, but failed
- but it should be `EventEvaluator`
- evaluator open: 4.4it/s
- evaluator close: 10.2it/s
- solution: do not evaluate during training
- [x] `obj_acc` appears in the view.
- remove old `ViewRecorder` and rename `MultiViewRecorder` to `ViewRecorder`.
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021-present Xin Hong
Copyright (c) 2022-present Xin Hong

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ Notice: We fixed a bug in TRANCE, therefore, the performance on Event and View i

The code is licensed under the [MIT license](./LICENSE) and the TRANCE dataset is licensed under the <a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/">Creative Commons Attribution-NonCommercial 4.0 International License</a>.

Notice: Some materials are directly inherited from [CLEVR](https://github.com/facebookresearch/clevr-dataset-gen) which are licensed under BSD License. More details can be found in [this document](data/gen_src/resource/README.md).
Notice: Some materials are directly inherited from [CLEVR](https://github.com/facebookresearch/clevr-dataset-gen) which are licensed under BSD License. More details can be found in [this document](data/gen_src/resource/README.md).
Loading

0 comments on commit 531cb97

Please sign in to comment.