test lazy also, make TestMNIST faster
MODIFY
.github/workflows/test.yml
.github/workflows/test.yml
@@ -52,6 +52,8 @@ jobs:
run: pip install -e '.[testing]'
- name: Run Pytest
run: python -m pytest -s -v
+ - name: Run Pytest (lazy)
+ run: LAZY=1 python -m pytest -s -v
testtorch:
name: Torch Tests
@@ -70,6 +72,8 @@ jobs:
run: pip install -e '.[testing]'
- name: Run Pytest
run: TORCH=1 python -m pytest -s -v
+ - name: Run Pytest (lazy)
+ run: LAZY=1 TORCH=1 python -m pytest -s -v
testgpu:
name: GPU Tests
@@ -94,6 +98,8 @@ jobs:
run: pip install -e '.[gpu,testing]'
- name: Run Pytest
run: GPU=1 python -m pytest -s -v
+ - name: Run Pytest (lazy)
+ run: LAZY=1 GPU=1 python -m pytest -s -v
testmypy:
name: Mypy Tests

MODIFY
test/test_mnist.py
test/test_mnist.py
@@ -81,21 +81,21 @@ class TestMNIST(unittest.TestCase):
np.random.seed(1337)
model = TinyConvNet()
optimizer = optim.Adam(model.parameters(), lr=0.001)
- train(model, X_train, Y_train, optimizer, steps=200)
+ train(model, X_train, Y_train, optimizer, steps=100)
assert evaluate(model, X_test, Y_test) > 0.95
def test_sgd(self):
np.random.seed(1337)
model = TinyBobNet()
optimizer = optim.SGD(model.parameters(), lr=0.001)
- train(model, X_train, Y_train, optimizer, steps=1000)
+ train(model, X_train, Y_train, optimizer, steps=600)
assert evaluate(model, X_test, Y_test) > 0.95
def test_rmsprop(self):
np.random.seed(1337)
model = TinyBobNet()
optimizer = optim.RMSprop(model.parameters(), lr=0.0002)
- train(model, X_train, Y_train, optimizer, steps=1000)
+ train(model, X_train, Y_train, optimizer, steps=400)
assert evaluate(model, X_test, Y_test) > 0.95
if __name__ == '__main__':

test lazy also, make TestMNIST faster