Added comment to trigger workflow #11
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
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!')" |