Skip to content

Commit 0324dd6

Browse files
committed
init repo
0 parents  commit 0324dd6

File tree

126 files changed

+9734
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+9734
-0
lines changed

.gitignore

+138
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# Custom files
2+
.DS_Store
3+
4+
# Byte-compiled / optimized / DLL files
5+
__pycache__/
6+
*.py[cod]
7+
*$py.class
8+
9+
# C extensions
10+
*.so
11+
12+
# Distribution / packaging
13+
.Python
14+
build/
15+
develop-eggs/
16+
dist/
17+
downloads/
18+
eggs/
19+
.eggs/
20+
lib/
21+
lib64/
22+
parts/
23+
sdist/
24+
var/
25+
wheels/
26+
pip-wheel-metadata/
27+
share/python-wheels/
28+
*.egg-info/
29+
.installed.cfg
30+
*.egg
31+
MANIFEST
32+
33+
# PyInstaller
34+
# Usually these files are written by a python script from a template
35+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
36+
*.manifest
37+
*.spec
38+
39+
# Installer logs
40+
pip-log.txt
41+
pip-delete-this-directory.txt
42+
43+
# Unit test / coverage reports
44+
htmlcov/
45+
.tox/
46+
.nox/
47+
.coverage
48+
.coverage.*
49+
.cache
50+
nosetests.xml
51+
coverage.xml
52+
*.cover
53+
*.py,cover
54+
.hypothesis/
55+
.pytest_cache/
56+
57+
# Translations
58+
*.mo
59+
*.pot
60+
61+
# Django stuff:
62+
*.log
63+
local_settings.py
64+
db.sqlite3
65+
db.sqlite3-journal
66+
67+
# Flask stuff:
68+
instance/
69+
.webassets-cache
70+
71+
# Scrapy stuff:
72+
.scrapy
73+
74+
# Sphinx documentation
75+
docs/_build/
76+
77+
# PyBuilder
78+
target/
79+
80+
# Jupyter Notebook
81+
.ipynb_checkpoints
82+
83+
# IPython
84+
profile_default/
85+
ipython_config.py
86+
87+
# pyenv
88+
.python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
98+
__pypackages__/
99+
100+
# Celery stuff
101+
celerybeat-schedule
102+
celerybeat.pid
103+
104+
# SageMath parsed files
105+
*.sage.py
106+
107+
# Environments
108+
.env
109+
.venv
110+
env/
111+
venv/
112+
ENV/
113+
env.bak/
114+
venv.bak/
115+
116+
# Spyder project settings
117+
.spyderproject
118+
.spyproject
119+
120+
# Rope project settings
121+
.ropeproject
122+
123+
# mkdocs documentation
124+
/site
125+
126+
# mypy
127+
.mypy_cache/
128+
.dmypy.json
129+
dmypy.json
130+
131+
# Pyre type checker
132+
.pyre/
133+
134+
# IDE
135+
.idea/
136+
.vscode/
137+
138+
results/*

.pre-commit-config.yaml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.0.1
4+
hooks:
5+
- id: check-yaml
6+
- id: end-of-file-fixer
7+
- id: trailing-whitespace
8+
- id: requirements-txt-fixer
9+
- id: fix-encoding-pragma
10+
- repo: https://github.com/psf/black
11+
rev: 21.7b0
12+
hooks:
13+
- id: black
14+
args: [ '--line-length', '100' ]
15+
language_version: python3
16+
- repo: https://gitlab.com/pycqa/flake8
17+
rev: 3.9.2
18+
hooks:
19+
- id: flake8
20+
args: [ '--max-line-length','100','--ignore','E731, E403, W503, E501, E203, F403, F401, E402', ]

.readthedocs.yaml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# .readthedocs.yaml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
# Build documentation in the docs/ directory with Sphinx
9+
sphinx:
10+
configuration: docs/conf.py
11+
12+
# Optionally build your docs in additional formats such as PDF
13+
formats:
14+
- pdf
15+
16+
# Optionally set the version of Python and requirements required to build your docs
17+
python:
18+
version: "3.7"
19+
install:
20+
- requirements: docs/requirements.txt

README.md

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# LibFewShot
2+
Make few shot learning easy.
3+
4+
## Supported Methods
5+
### Meta
6+
+ MAML(ICML'17)
7+
+ ANIL(ICLR'20)
8+
+ R2D2(ICLR'19)
9+
+ Versa(NeurIPS'18)
10+
+ LEO(ICLR'19)
11+
+ MTL(CVPR'19)
12+
### Metric
13+
+ ProtoNet(NeuraIPS'17)
14+
+ RelationNet(CVPR'18)
15+
+ ConvaMNet(AAAI'19)
16+
+ DN4(CVPR'19)
17+
+ CAN(NeuraIPS'19)
18+
### Finetuning
19+
+ Baseline(ICLR'19)
20+
+ Baseline++(ICLR'19)
21+
+ RFS(ECCV'20)
22+
+ SKD(arxiv'20)
23+
24+
25+
## Quick Installnation
26+
27+
Please refer to [install.md](https://doc-test-en.readthedocs.io/en/latest/install.html)([安装](https://doc-test-en.readthedocs.io/zh_CN/latest/install.html)) for installation.
28+
29+
Full tutorials can be found at [document](https://doc-test-en.readthedocs.io/en/latest/)([中文文档](https://doc-test-en.readthedocs.io/zh_CN/latest/index.html)).
30+
31+
## Contributing
32+
Feel free to contribute any kind of function or enhancement, here the coding style follows PEP8. Please refer to [contributing.md](https://doc-test-en.readthedocs.io/en/latest/contributing.html)([贡献代码](https://doc-test-en.readthedocs.io/zh_CN/latest/contributing.html)) for the contributing guideline.
33+
34+
## License
35+
This project is licensed under the MIT License. See LICENSE for more details
36+
37+
## Acknowledgement
38+
LibFewShot is an open source project designed to help few shot learning researchers quickly understand the classic methods and code structures. We welcome other contributors to use the LibFewShot framework to implement some methods and add them to this library. This library can be used for academic research. We welcome researchers in the field of fes shot learning to use LibFewShot to implement their own methods, and welcome feedback when using LibFewShot. We will try our best to improve the library.
39+
40+
## Citation
41+
If you use this code for your research, please cite our paper.
42+
```
43+
@article{li2021LibFewShot,
44+
title={LibFewShot: A Comprehensive Library for Few-shot Learning},
45+
author={Wenbin Li, Chuanqi Dong, Pinzhuo Tian, Tiexin Qin, Xuesong Yang, Ziyi Wang, Jing Huo, Yinghuan Shi, Lei Wang, Yang Gao, Jiebo Luo},
46+
journal={arXiv preprint arXiv:2109.04898},
47+
year={2021}
48+
}
49+
```

config/adm.yaml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
includes:
2+
- headers/data.yaml
3+
- headers/device.yaml
4+
- headers/losses.yaml
5+
- headers/misc.yaml
6+
- headers/model.yaml
7+
- headers/optimizer.yaml
8+
- classifiers/ADM.yaml
9+
10+
way_num: 5
11+
shot_num: 1
12+
query_num: 15
13+
14+
backbone:
15+
name: Conv64F
16+
kwargs:
17+
is_flatten: False
18+
is_feature: False
19+
leaky_relu: True
20+
negative_slope: 0.2
21+
last_pool: False
22+
23+
24+
# backbone:
25+
# name: resnet12
26+
# kwargs:
27+
# maxpool_last2: False
28+
# is_flatten: False
29+
30+
31+
# need to modify: core/model/backbone/resnet_18.py:114 stride=1
32+
# backbone:
33+
# name: resnet18
34+
# kwargs:
35+
# is_flatten: False
36+
# avg_pool: False
37+
38+
39+
# backbone:
40+
# name: WRN
41+
# kwargs:
42+
# depth: 28
43+
# widen_factor: 10
44+
# avg_pool: False
45+
# is_flatten: False

config/adm_kl.yaml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
includes:
2+
- headers/data.yaml
3+
- headers/device.yaml
4+
- headers/losses.yaml
5+
- headers/misc.yaml
6+
- headers/model.yaml
7+
- headers/optimizer.yaml
8+
- classifiers/ADM_KL.yaml
9+
10+
device_ids: 2
11+
12+
way_num: 5
13+
shot_num: 1
14+
query_num: 15
15+
test_way: 5 # use ~ -> test_* = *_num
16+
test_shot: 1
17+
test_query: 15
18+
19+
20+
# backbone:
21+
# name: Conv64F
22+
# kwargs:
23+
# is_flatten: False
24+
# is_feature: False
25+
# leaky_relu: True
26+
# negative_slope: 0.2
27+
# last_pool: False
28+
29+
30+
# backbone:
31+
# name: resnet12
32+
# kwargs:
33+
# maxpool_last2: False
34+
# is_flatten: False
35+
36+
37+
# need to modify: core/model/backbone/resnet_18.py:114 stride=1
38+
# backbone:
39+
# name: resnet18
40+
# kwargs:
41+
# is_flatten: False
42+
# avg_pool: False
43+
44+
45+
backbone:
46+
name: WRN
47+
kwargs:
48+
depth: 28
49+
widen_factor: 10
50+
avg_pool: False
51+
is_flatten: False

config/anil.yaml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
includes:
2+
- headers/data.yaml
3+
- headers/device.yaml
4+
- headers/losses.yaml
5+
- headers/misc.yaml
6+
- headers/model.yaml
7+
- headers/optimizer.yaml
8+
- classifiers/ANIL.yaml
9+
- backbones/resnet12.yaml
10+
11+
12+
device_ids: 0
13+
way_num: 5
14+
shot_num: 1
15+
query_num: 15
16+
test_way: 5 # use ~ -> test_* = *_num
17+
test_shot: 1
18+
test_query: 15
19+
episode_size: 1
20+
train_episode: 100
21+
test_episode: 100
22+
23+
backbone:
24+
name: Conv64F
25+
kwargs:
26+
is_flatten: True
27+
is_feature: False
28+
leaky_relu: False
29+
negative_slope: 0.2
30+
last_pool: True
31+
32+
# backbone:
33+
# name: resnet12
34+
# kwargs:
35+
# keep_prob: 0.0
36+
37+
# backbone:
38+
# name: resnet18
39+
# kwargs:
40+
41+
# backbone:
42+
# name: WRN
43+
# kwargs:
44+
# depth: 10
45+
# widen_factor: 10
46+
# dropRate: 0.0
47+
# avg_pool: True
48+
# is_flatten: True

0 commit comments

Comments
 (0)