Browse Source

changed framesize dataset to 60
added statistic figures of dataset
added matlab script to show samples of the data

Sebastian Vendt 6 years ago
parent
commit
53d4d78d8f

BIN
MATLAB/TrainingData/2019_09_09_1658_TEST.mat


BIN
MATLAB/TrainingData/2019_09_09_1658_TRAIN.mat


BIN
MATLAB/TrainingData/2019_09_09_1658_VAL.mat


BIN
MATLAB/TrainingData/Hist_MinMax.fig


BIN
MATLAB/TrainingData/Hist_Pause.fig


BIN
MATLAB/TrainingData/Hist_duration.fig


+ 2 - 2
MATLAB/generate.m

@@ -1,6 +1,6 @@
 % One need to determine the framesize and frameoffset beforehand...
-framesize = 48;
-frameoffset = 25;
+framesize = 60; % was 48
+frameoffset = 28;
 maxFrameShift = 10;
 splitRatio = [70, 20, 10]; % percentage of training, validation, testing needs to add up to 100!!!
 file = '2019_09_09_1658';

+ 20 - 0
MATLAB/showMotionData.m

@@ -0,0 +1,20 @@
+function showMotionData(data, idx, x, y)
+
+    X = 1:48;
+    figure1 = figure;
+    hold on
+    plot (X, data(:,1,idx))
+    plot (X, data(:,2,idx))
+    plot (X, data(:,3,idx))
+    title(sprintf("sampled from dataset, Gyroscope trace of x:%d, y:%d", x, y))
+    legend({'GYRO_X', 'GYRO_Y', 'GYRO_Z'})
+    hold off
+    figure2 = figure;
+    hold on
+    plot (X, data(:,4,idx))
+    plot (X, data(:,5,idx))
+    plot (X, data(:,6,idx))
+    title(sprintf("sampled from dataset, Accelerometer trace of x:%d, y:%d", x, y))
+    legend({'ACC_X', 'ACC_Y', 'ACC_Z'})
+    hold off
+end

+ 7 - 7
julia/net.jl

@@ -60,7 +60,7 @@ const printout_interval = 5
 const save_interval = 25
 const time_format = "HH:MM:SS"
 const date_format = "dd_mm_yyyy"
-data_size = (48, 6) # resulting in a 240ms frame
+data_size = (60, 6) # resulting in a 300ms frame
 
 # ARCHITECTURE
 channels = 1
@@ -70,13 +70,13 @@ features3 = 128 # needs to find the relation between the axis which represents t
 kernel1 = (3,1)  # convolute only horizontally
 kernel2 = kernel1  # same here
 kernel3 = (3, 6) # this should convolute all 6 rows together to map relations between the channels  
-pooldims1 = (2,1)# (24,6)
-pooldims2 = (2,1)# (12,6)
+pooldims1 = (2,1)# (30,6)
+pooldims2 = (2,1)# (15,6)
 # pooldims3 = (2,1)# (1, 4)
-inputDense1 = 1280 # prod(data_size .÷ pooldims1 .÷ pooldims2 .÷ kernel3) * features3
-inputDense2 = 500
+inputDense1 = 1664 # prod(data_size .÷ pooldims1 .÷ pooldims2 .÷ kernel3) * features3
+inputDense2 = 600
 inputDense3 = 300
-dropout_rate = 0.1f0
+dropout_rate = 0.3f0
 
 dataset_folderpath = "../MATLAB/TrainingData/"
 dataset_name = "2019_09_09_1658"
@@ -103,7 +103,7 @@ end
 
 function loss(x, y) 
 	# quadratic euclidean distance + parameternorm?
-	return Flux.mse(model(x), y)
+	return Flux.mse(model(x), y) + lambda * sum(norm, params(model))
 end
 
 function loss(dataset)