Skip to content

Improved parameter counting and model summary utilities with detailed… #3

Improved parameter counting and model summary utilities with detailed…

Improved parameter counting and model summary utilities with detailed… #3

Workflow file for this run

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 MNISTModel
from utils import count_parameters, has_batch_norm, has_dropout, has_fully_connected
model = MNISTModel()
# 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!')"