-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (42 loc) · 1.32 KB
/
mnist_tests.yml
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
name: MNIST Model Tests
on:
push:
paths:
- 'MNIST_99.4/**'
branches: [ main ]
pull_request:
paths:
- 'MNIST_99.4/**'
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./MNIST_99.4
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install torch torchvision pytest
- name: Run tests
run: |
python -m pytest tests/test_model.py -v
- name: Verify model architecture
run: |
python -c "
from models.model import FastMNIST
from utils import count_parameters, has_batch_norm, has_dropout, has_fully_connected
model = FastMNIST()
# Check parameters count
assert count_parameters(model) <= 20000, 'Model exceeds 20k parameters'
# Check architecture requirements
assert has_batch_norm(model), 'Missing Batch Normalization'
assert has_dropout(model), 'Missing Dropout'
assert has_fully_connected(model), 'Missing Fully Connected Layer'
print('All architecture checks passed!')"