X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=cnn-svrt.py;h=da039614e58c59a617e02d22b963068bb367e4ff;hb=34aeb8100a6c19dae72779f9e46a0acbb5a069c7;hp=cfef09da934fb5d82181715f428dab1a261d04ba;hpb=37030c396217cfe89f8dfa2b9e10ff1ec783a5a7;p=pysvrt.git
diff --git a/cnn-svrt.py b/cnn-svrt.py
index cfef09d..da03961 100755
--- a/cnn-svrt.py
+++ b/cnn-svrt.py
@@ -19,11 +19,12 @@
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with selector. If not, see .
+# along with pysvrt. If not, see .
import time
import argparse
import math
+import distutils.util
from colorama import Fore, Back, Style
@@ -65,15 +66,15 @@ parser.add_argument('--log_file',
type = str, default = 'default.log')
parser.add_argument('--compress_vignettes',
- action='store_true', default = True,
+ type = distutils.util.strtobool, default = 'True',
help = 'Use lossless compression to reduce the memory footprint')
parser.add_argument('--deep_model',
- action='store_true', default = True,
+ type = distutils.util.strtobool, default = 'True',
help = 'Use Afroze\'s Alexnet-like deep model')
parser.add_argument('--test_loaded_models',
- action='store_true', default = False,
+ type = distutils.util.strtobool, default = 'False',
help = 'Should we compute the test errors of loaded models')
args = parser.parse_args()
@@ -143,22 +144,6 @@ class AfrozeShallowNet(nn.Module):
# Afroze's DeepNet
-# map size nb. maps
-# ----------------------
-# input 128x128 1
-# -- conv(21x21 x 32 stride=4) -> 28x28 32
-# -- max(2x2) -> 14x14 6
-# -- conv(7x7 x 96) -> 8x8 16
-# -- max(2x2) -> 4x4 16
-# -- conv(5x5 x 96) -> 26x36 16
-# -- conv(3x3 x 128) -> 36x36 16
-# -- conv(3x3 x 128) -> 36x36 16
-
-# -- conv(5x5 x 120) -> 1x1 120
-# -- reshape -> 120 1
-# -- full(3x84) -> 84 1
-# -- full(84x2) -> 2 1
-
class AfrozeDeepNet(nn.Module):
def __init__(self):
super(AfrozeDeepNet, self).__init__()
@@ -269,8 +254,10 @@ if args.nb_train_samples%args.batch_size > 0 or args.nb_test_samples%args.batch_
raise
if args.compress_vignettes:
+ log_string('using_compressed_vignettes')
VignetteSet = vignette_set.CompressedVignetteSet
else:
+ log_string('using_uncompressed_vignettes')
VignetteSet = vignette_set.VignetteSet
for problem_number in range(1, 24):