Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add .gitignore and main.py torch is not defined #124

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.pyc
data
__pycache__
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def train(epoch):
% (train_loss/(batch_idx+1), 100.*correct/total, correct, total))


def test(epoch):
def test_net(epoch):
global best_acc
net.eval()
test_loss = 0
Expand Down Expand Up @@ -148,4 +148,4 @@ def test(epoch):

for epoch in range(start_epoch, start_epoch+200):
train(epoch)
test(epoch)
test_net(epoch)
2 changes: 1 addition & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import torch.nn as nn
import torch.nn.init as init

import torch

def get_mean_and_std(dataset):
'''Compute the mean and std value of dataset.'''
Expand Down