Jelajahi Sumber

bugfixes in net.jl

Sebastian Vendt 6 tahun lalu
induk
melakukan
dc970de46e

+ 5 - 0
julia/logs/csv_17_09_2019.csv

@@ -0,0 +1,5 @@
+epoch, loss(train)
+0, 0.136450
+5, 0.068499
+10, 0.063806
+10, 0.063806

+ 0 - 7
julia/logs/log_11_09_2019.log

@@ -1,7 +0,0 @@
-
---------[11_09_2019 14:04:39]--------
-
---------[11_09_2019 14:45:23]--------
-
---------[11_09_2019 14:47:12]--------
-[14:47:11] INIT with Loss(test_set): 915655.000000

+ 24 - 0
julia/logs/log_13_09_2019.log

@@ -0,0 +1,24 @@
+
+--------[13_09_2019 21:37:09]--------
+[21:38:08] INIT with Loss(val_set): 0.126601
+[21:40:23] Epoch   5: Loss: 0.066853
+[21:41:15] Epoch  10: Loss: 0.061259
+[21:42:08] Epoch  15: Loss: 0.058832
+[21:43:00] Epoch  20: Loss: 0.056455
+[21:43:53] Epoch  25: Loss: 0.054665
+[21:44:46] Epoch  30: Loss: 0.053267
+[21:45:40] Epoch  35: Loss: 0.052252
+[21:46:34] Epoch  40: Loss: 0.051444
+[21:47:28] Epoch  45: Loss: 0.050981
+[21:48:22] Epoch  50: Loss: 0.050672
+[21:49:15] Epoch  55: Loss: 0.050308
+[21:50:08] Epoch  60: Loss: 0.049819
+[21:51:02] Epoch  65: Loss: 0.049450
+[21:51:56] Epoch  70: Loss: 0.048893
+[21:52:50] Epoch  75: Loss: 0.048296
+[21:53:45] Epoch  80: Loss: 0.047833
+[21:54:39] Epoch  85: Loss: 0.047494
+[21:55:33] Epoch  90: Loss: 0.047271
+[21:56:28] Epoch  95: Loss: 0.047155
+[21:57:22] Epoch 100: Loss: 0.047089
+[21:57:24] FINAL Loss(val_set): 0.048739

+ 34 - 0
julia/logs/log_17_09_2019.log

@@ -0,0 +1,34 @@
+
+--------[17_09_2019 15:39:25]--------
+performance test with model as global variable
+[15:40:25] Epoch   0: Loss(train): 0.141246
+[15:42:47] Epoch   5: Loss(train): 0.069754
+[15:43:42] Epoch  10: Loss(val): 0.063152
+[15:43:45] Epoch  10: Loss(val): 0.063152
+
+--------[17_09_2019 15:44:55]--------
+performance test with model as local variable
+[15:46:02] Epoch   0: Loss(train): 0.130723
+[15:48:20] Epoch   5: Loss(train): 0.067204
+[15:49:14] Epoch  10: Loss(val): 0.062262
+[15:49:17] Epoch  10: Loss(val): 0.062262
+
+--------[17_09_2019 16:08:41]--------
+performance test with model as global variable
+
+--------[17_09_2019 16:12:33]--------
+performance test with model as global variable
+
+--------[17_09_2019 16:15:37]--------
+performance test with model as global variable
+[16:17:15] Epoch   0: Loss(train): 0.123774
+[16:20:45] Epoch   5: Loss(train): 0.069634
+[16:21:59] Epoch  10: Loss(val): 0.062199
+[16:22:02] Epoch  10: Loss(val): 0.062199
+
+--------[17_09_2019 16:30:18]--------
+performance test with model as global variable
+[16:31:53] Epoch   0: Loss(train): 0.136450
+[16:35:26] Epoch   5: Loss(train): 0.068499
+[16:36:39] Epoch  10: Loss(val): 0.064055
+[16:36:43] Epoch  10: Loss(val): 0.064055

+ 6 - 6
julia/net.jl

@@ -97,7 +97,7 @@ end
 
 debug_str = ""
 log_msg = parsed_args["logmsg"]
-csv_out = parse_args["csv"]
+csv_out = parsed_args["csv"]
 @debug begin
 	global debug_str
 	debug_str = "DEBUG_"
@@ -108,7 +108,7 @@ io = nothing
 io_csv = nothing
 
 function adapt_learnrate(epoch_idx)
-    return init_learning_rate * decay_rate^(epoch_idx / decay_step)
+    return learning_rate * decay_rate^(epoch_idx / decay_step)
 end
 
 function loss(x, y) 
@@ -202,12 +202,12 @@ end
 flush(io)
 flush(Base.stdout)
 
-train_set, validation_set, test_set = load_dataset()
+train, validation, test = load_dataset()
 
 if (usegpu)
-	train_set = gpu.(train_set)
-	validation_set = gpu.(validation_set)
-	test_set = gpu.(test_set)
+	train_set = gpu.(train)
+	validation_set = gpu.(validation)
+	test_set = gpu.(test)
 	model = gpu(model)
 end
 

+ 2 - 2
julia/net_local.jl

@@ -97,7 +97,7 @@ end
 
 debug_str = ""
 log_msg = parsed_args["logmsg"]
-csv_out = parse_args["csv"]
+csv_out = parsed_args["csv"]
 @debug begin
 	global debug_str
 	debug_str = "DEBUG_"
@@ -108,7 +108,7 @@ io = nothing
 io_csv = nothing
 
 function adapt_learnrate(epoch_idx)
-    return init_learning_rate * decay_rate^(epoch_idx / decay_step)
+    return learning_rate * decay_rate^(epoch_idx / decay_step)
 end
 
 function loss(model, x, y) 

+ 3 - 1
julia/trainer.sh

@@ -1,4 +1,6 @@
 #!/bin/bash
 CUDA_VISIBLE_DEVICES='1'
 
-julia $1 # net.jl
+julia net.jl --gpu --epochs 10 --csv --logmsg "performance test with model as global variable" --eval
+# julia net_local.jl --gpu --epochs 10 --csv --logmsg "performance test with model as local variable" --eval
+