-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
537 changed files
with
9,275 additions
and
277,706 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Laia CI | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
paths-ignore: ['README.md'] | ||
pull_request: | ||
schedule: | ||
# at 07:00 on Sunday | ||
- cron: '0 7 * * sun' | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Run pre-commit | ||
run: | | ||
pip install pre-commit | ||
pre-commit run --all-files | ||
pytest: | ||
name: Python ${{ matrix.python }} - PyTorch ${{ matrix.torch }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# TODO: include 3.9 when NumPy adds support | ||
python: [3.8, 3.7, 3.6] | ||
# TODO: include 1.7.* when 1.7.1 is released | ||
torch: [1.6.*, 1.5.*, 1.4.*] | ||
# fix torchvision and nnutils versions for each torch version | ||
include: | ||
#- torch: 1.7.* | ||
# # TODO: update when released | ||
# nnutils: 1.6.* | ||
# torchvision: 0.8.* | ||
- torch: 1.6.* | ||
nnutils: 1.6.* | ||
torchvision: 0.7.* | ||
- torch: 1.5.* | ||
nnutils: 1.5.* | ||
torchvision: 0.6.* | ||
- torch: 1.4.* | ||
nnutils: 1.4.* | ||
torchvision: 0.5.* | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- name: Configure requirements | ||
run: | | ||
sed -i s/^torch\<1.7.0$/torch==${{ matrix.torch }}/ requirements.txt | ||
sed -i s/^torchvision\<0.8.0$/torchvision==${{ matrix.torchvision }}/ requirements.txt | ||
sed -i s/^nnutils-pytorch$/nnutils-pytorch==${{ matrix.nnutils }}/ requirements.txt | ||
- name: Install requirements | ||
run: pip install -e .[test] | ||
- name: Run pytest | ||
run: pytest --cov=laia tests | ||
- uses: codecov/codecov-action@v1 | ||
# upload coverage only for main job | ||
if: ${{ matrix.python == '3.8' && matrix.torch == '1.6.*'}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
exclude: egs/* | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.3.0 | ||
rev: v3.3.0 | ||
hooks: | ||
- id: check-yaml | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- repo: https://github.com/timothycrosley/isort | ||
rev: 5.6.4 | ||
hooks: | ||
- id: isort | ||
args: [--profile, black] | ||
- repo: https://github.com/psf/black | ||
rev: 19.3b0 | ||
rev: 20.8b1 | ||
hooks: | ||
- id: black |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Contributing | ||
|
||
Contributions are welcome! Either by reporting bugs, requesting features, or even creating a pull request yourself. | ||
|
||
Use this recipe to get ready to work on PyLaia: | ||
|
||
```console | ||
# clone PyLaia | ||
git clone https://github.com/jpuigcerver/PyLaia | ||
cd PyLaia | ||
|
||
# use a clean Python environment. | ||
# you can skip this if you prefer conda | ||
virtualenv laia-env | ||
source laia-env/bin/activate | ||
|
||
# install all dependencies in editable mode, | ||
# including those for development and testing | ||
pip install --editable ".[dev,test]" | ||
|
||
# set-up pre-commit hooks | ||
pre-commit install | ||
``` | ||
|
||
You can run the test suite (including a coverage report) with: | ||
|
||
```console | ||
pytest --cov=laia tests | ||
``` | ||
|
||
Do not worry about code formatting, `pre-commit` will do the work for you when you try to commit. You can also run it manually with: | ||
|
||
```console | ||
pre-commit run --all-files | ||
``` | ||
|
||
Commits and pull requests are tested using GitHub actions CI, so you don't have to worry about testing each Python and PyTorch version combination. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
exclude .pre-commit-config.yaml | ||
exclude CONTRIBUTING.md | ||
|
||
prune .github | ||
prune benchmarks | ||
prune tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Benchmarks | ||
|
||
This is a minimal collection of training benchmarks used to evaluate PyLaia's performance. | ||
|
||
You can think of these as an extended suite of training tests which require a GPU, thus cannot be run in CI. | ||
|
||
### Data | ||
|
||
All the tests use a synthetic dataset we call "MNIST-lines", where MNIST digits are randomly selected to form text-line images, with spaces randomly added. | ||
|
||
For larger experiments using real datasets, please have a look at the PyLaia examples [repository](https://github.com/carmocca/PyLaia-examples). | ||
|
||
### Running | ||
|
||
The following are available. Note that all of them require that CUDA is available: | ||
|
||
- `basic.py`: Run Laia's CRNN model for a fixed number of epochs. | ||
- `distributed.py`: On 2 GPUs. | ||
- `half.py`: Using AMP's 16bit precision. |
Oops, something went wrong.