-
Notifications
You must be signed in to change notification settings - Fork 349
66 lines (66 loc) · 2.18 KB
/
Copy pathtraining.yml
File metadata and controls
66 lines (66 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Full training validation
on:
workflow_dispatch:
schedule:
- cron: '23 6 * * 1'
permissions:
contents: read
concurrency:
group: full-training-${{ github.ref }}
cancel-in-progress: false
jobs:
notebooks:
name: Train ${{ matrix.notebook }}
runs-on: ubuntu-24.04
timeout-minutes: 210
strategy:
fail-fast: false
max-parallel: 3
matrix:
notebook:
- Appendix/Appendix.ipynb
- Chapter 1/Ch1_Introduction.ipynb
- Chapter 2/Ch2_book.ipynb
- Chapter 3/Ch3_book.ipynb
- Chapter 4/Ch4_book.ipynb
- Chapter 5/Ch5_book.ipynb
- Chapter 6/Ch6_book.ipynb
- Chapter 6/MNIST Genetic Algorithm.ipynb
- Chapter 7/Ch7_book.ipynb
- Chapter 8/Ch8_book.ipynb
- Chapter 9/Ch9_book.ipynb
- Chapter 10/Ch10_book.ipynb
- old_but_more_detailed/Ch4_PolicyGradients_.ipynb
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-python@v5
with:
python-version: '3.13'
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install torch==2.13.0 torchvision==0.28.0 --index-url https://download.pytorch.org/whl/cpu
python -m pip install -r requirements.txt
python -m pip check
- name: Execute all cells with full training budgets
env:
NOTEBOOK: ${{ matrix.notebook }}
run: python scripts/check_notebooks.py --mode full --notebook "$NOTEBOOK"
- name: Train standalone genetic CartPole with default budget
if: matrix.notebook == 'Chapter 6/Ch6_book.ipynb'
env:
OMP_NUM_THREADS: '1'
MKL_NUM_THREADS: '1'
run: |
mkdir -p artifacts/standalone
python "Chapter 6/main.py" --save_file artifacts/standalone/weights.pth > artifacts/standalone/training.log 2>&1
- name: Retain notebook logs and metrics
if: always()
uses: actions/upload-artifact@v4
with:
name: training-${{ strategy.job-index }}
path: artifacts/
retention-days: 30