Skip to content

Commit

Permalink
Update : Modifier details in the model
Browse files Browse the repository at this point in the history
  • Loading branch information
Kabongosalomon committed Jan 17, 2020
1 parent 0791a13 commit 4d28b28
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
print(model_scratch)

model_scratch = train_class.train(10, loaders_scratch, model_scratch, optimizer_scratch,
criterion_scratch, use_cuda, './model/model_scratch.pt') # You can rename this file to save different check point
criterion_scratch, use_cuda, './model/model_cnn_2.pt') # You can rename this file to save different check point

# load the model that got the best validation accuracy
# model_scratch.load_state_dict(torch.load('./model/model_scratch.pt')) # uncomment only to load the saved model
Expand Down
10 changes: 5 additions & 5 deletions model.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ def __init__(self, n_feature, output_size):

## Define layers of a CNN
self.conv1 = nn.Conv2d(3, n_feature*2**1, 3, padding=1, stride=2)
self.conv2 = nn.Conv2d(32, n_feature*2**2, 3, padding=1, stride=2)
self.conv3 = nn.Conv2d(64, n_feature*2**3, 3, padding=1)
self.conv2 = nn.Conv2d(n_feature*2**1, n_feature*2**2, 3, padding=1, stride=2)
self.conv3 = nn.Conv2d(n_feature*2**2, n_feature*2**3, 3, padding=1)

# max pooling layer
self.pool = nn.MaxPool2d(2, 2)
Expand Down Expand Up @@ -45,9 +45,9 @@ def __init__(self, n_feature, output_size):

## Define layers of a CNN
self.conv1 = nn.Conv2d(3, n_feature*2**1, 3, padding=1, stride=2)
self.conv2 = nn.Conv2d(32, n_feature*2**2, 3, padding=1, stride=2)
self.conv3 = nn.Conv2d(64, n_feature*2**3, 3, padding=1)
self.conv4 = nn.Conv2d(128, n_feature*2**4, 3, padding=1, stride=2)
self.conv2 = nn.Conv2d(n_feature*2**1, n_feature*2**2, 3, padding=1, stride=2)
self.conv3 = nn.Conv2d(n_feature*2**2, n_feature*2**3, 3, padding=1)
self.conv4 = nn.Conv2d(n_feature*2**3, n_feature*2**4, 3, padding=1, stride=2)

# max pooling layer
self.pool = nn.MaxPool2d(2, 2)
Expand Down

0 comments on commit 4d28b28

Please sign in to comment.