Please could you help me about how to make deep learning to the following problem: I have got a lot of 3D matrix, as input, and as tester, these datas include PM rates, which is very important to me...


Please could you help me about how to make deep learning to the following problem:


I have got a lot of 3D matrix, as input, and as tester, these datas include PM rates, which is very important to me to select training and valudating datas.
The 3D matrix contains the following datas:
soundTrace
pressureTrace
crankAngle
Before I already used feedforwardnet (machinelearning) neural networks by the following way.
It is worked, but my job is to make it by using deep learning.
Unfortunately I have not any experience by the deep learning.
Please could you help me how should I solve this problem by using deep learning instead of machine learning?
Is it even solvable by matlab?
Data code of forward network in the attachment.
Thank you in advance!




1.Inicializáció clc; clear all; % crankAngle (1024 x N x 3) % pressureTrace (1024 x N x 3) % soundTrace (1024 x N x 3) % A neurális háló struktúrájának meghatározása net_ff=feedforwardnet([16 16 16]); 2.A tanítani/tesztelni kívánt adatsorok kiválasztása for dataNum = 13 %[1 2 3 4 5 6 7 8 9 10] % Switch switch dataNum case 1 load('data20140930T172556_MP2_20140930T171348-20140930T172548.mat'); PM = 17.7; case 2 load('data20140930T175219_MP3_20140930T174257-20140930T175209.mat'); PM = 17.7; case 3 load('data20140930T181114_MP1_20140930T180143-20140930T181104.mat'); PM = 17.7; case 4 load('data20141006T160647_MP15_20141006T160138-20141006T160638.mat'); PM = 10.3; case 5 load('data20141006T192818_MP9_20141006T192121-20141006T192812.mat'); PM = 20.6; case 6 load('data20141007T105416_MP10_20141007T104626-20141007T105356.mat'); PM = 20.6; case 7 load('data20141007T111725_MP11_20141007T111034-20141007T111716.mat'); PM = 20.6; case 8 load('data20141007T115812_MP12a_20141007T115122-20141007T115804.mat'); PM = 20.6; case 9 load('data20141007T170303_MP23_KG_20141007T165555-20141007T170255.mat'); PM = 10.7; case 10 load('data20141024T183913_MP35_VSR44_MP2_20141024T183155-20141024T183904.mat'); PM = 10.3; case 11 load('data20141001T164947_MP13_20141001T163817-20141001T164938.mat'); PM = 20.6; case 12 load('data20141006T153844_MP13b_20141006T151423-20141006T153835.mat'); PM = 20.6; case 13 load('data20141027T101018_MP23_VSR44_MP3_20141027T100306-20141027T101009.mat'); PM = 20.6; case 14 load('data20150326T102904_VSR263_MP01_20150326T102542-20150326T102854.mat'); PM = 20.6; case 15 load('data20150326T104142_VSR263_MP02_20150326T103824-20150326T104133.mat'); PM = 8.8; case 16 load('data20141001T160416_MP4_20141001T154428-20141001T160407.mat'); PM = 17.7; case 17 load('data20141006T154840_MP14_20141006T153906-20141006T154830.mat'); PM = 8.8; case 18 load('data20140922T144607_MP05_20140922T143229-20140922T144556.mat'); PM = 10.3; case 19 load('data20141027T103317_MP31_VSR44_MP4_20141027T102626-20141027T103308.mat'); PM = 20.6; case 20 load('data20140922T134559_MP06_20140922T133344-20140922T134550.mat'); PM = 10.3; case 21 load('data20141006T153844_MP13b_20141006T151423-20141006T153835.mat'); PM = 10.3; otherwise error('datasetName is unknown') end 3.Adatok felbontása 2 dimenziós mátrixokká %mx_crankAngle = crankAngle; mx_pressureTrace_1 = pressureTrace(:,:,1); mx_pressureTrace_2 = pressureTrace(:,:,2); mx_pressureTrace_3 = pressureTrace(:,:,3); mx_soundTrace_1 = soundTrace(:,:,1); mx_soundTrace_2 = soundTrace(:,:,2); mx_soundTrace_3 = soundTrace(:,:,3); 4.Mátrix méretek meghatározása n_pontok = size(pressureTrace,1); % mindig 1024 n_ciklus = size(pressureTrace,2); % változó, a munkaciklusok száma %n_dim = size(pressureTrace,3); % mindig 3 n_dim = 3; % mindig 3 clear pressureTrace; clear soundTrace; clear crankAngle; 5.Referencia nyomásgörbe szűrése pressure_noise = filt_pressure - mx_pressureTrace_1; % Szűrő fokszáma order_p = 1; % Szűrő ablak hossza framelen_p = 15; % Szűrt jelek változóinak inicializálása filt_p_1 = zeros(n_pontok,n_ciklus); filt_p_2 = zeros(n_pontok,n_ciklus); filt_p_3 = zeros(n_pontok,n_ciklus); % Szűrés for i = 1:n_ciklus filt_p_1(:,i) = sgolayfilt(mx_pressureTrace_1(:,i),order_p,framelen_p); filt_p_2(:,i) = sgolayfilt(mx_pressureTrace_2(:,i),order_p,framelen_p); filt_p_3(:,i) = sgolayfilt(mx_pressureTrace_3(:,i),order_p,framelen_p); end 6.Zaj meghatározása különbségképzéssel, integrálás mx_noise_p_1 = filt_p_1 - mx_pressureTrace_1; mx_noise_p_2 = filt_p_2 - mx_pressureTrace_2; mx_noise_p_3 = filt_p_3 - mx_pressureTrace_3; clear filt_p_1 filt_p_2 filt_p_3; % Zaj integrál változóinak inicializálása integral_p_1 = zeros(1,n_ciklus); integral_p_2 = zeros(1,n_ciklus); integral_p_3 = zeros(1,n_ciklus); % Zaj nagyságának megmérése abszolútértékképzéssel és integrálással for i = 1:n_ciklus integral_p_1(1,i)=trapz(abs(mx_noise_p_1(:,i))); integral_p_2(1,i)=trapz(abs(mx_noise_p_2(:,i))); integral_p_3(1,i)=trapz(abs(mx_noise_p_3(:,i))); end %Integrál értékek egész számokra kerekítése integral_p_1_round = round(integral_p_1); integral_p_2_round = round(integral_p_2); integral_p_3_round = round(integral_p_3); 7.Neurális háló tanításának előkészítése %tanító, teszt és validáló minták aránya train_percent=0.8; valid_percent=0.1; %test_percent= 1-train_percent-valid_percent; % tanító, teszt és validáló minták száma n_vect_train=round(n_ciklus*train_percent); n_vect_valid=round(n_ciklus*valid_percent); n_vect_test=n_ciklus-n_vect_train-n_vect_valid; % tanító, validáló, tesztelő input mátrixok és output vektorok létrehozása mx_soundTrace_train_1 = zeros(n_pontok,ceil(n_vect_train/10)); integral_p_1_round_train = zeros(1,ceil(n_vect_train/10)); for i=1:10:n_vect_train mx_soundTrace_train_1(:,1+floor(i/10)) = mx_soundTrace_1(:,i); integral_p_1_round_train(1,1+floor(i/10)) = integral_p_1_round(1,i); end mx_soundTrace_valid_1 = zeros(n_pontok,ceil(n_vect_valid/10)); integral_p_1_round_valid = zeros(1,ceil(n_vect_valid/10)); for i=1:10:n_vect_valid mx_soundTrace_valid_1(:,1+floor(i/10)) = mx_soundTrace_1(:,n_vect_train+i); integral_p_1_round_valid(1,1+floor(i/10)) = integral_p_1_round(1,n_vect_train+i); end validation.P = mx_soundTrace_valid_1(1:400,:); validation.T = integral_p_1_round_valid; mx_soundTrace_test_1=zeros(n_pontok,ceil(n_vect_test/10)); integral_p_1_round_test = zeros(1,ceil(n_vect_test/10)); for i=1:10:n_vect_test mx_soundTrace_test_1(:,1+floor(i/10))=mx_soundTrace_1(:,n_vect_train+n_vect_valid+i); integral_p_1_round_test(1,1+floor(i/10))=integral_p_1_round(1,n_vect_train+n_vect_valid+i); end test.P = mx_soundTrace_test_1(1:400,:); test.T = integral_p_1_round_test; save('mx_soundTrace_train_1','mx_soundTrace_train_1'); save('integral_p_1_round_train','integral_p_1_round_train'); save('net_ff','net_ff') %save('validation','validation'); %save('test','test'); clear all; load ('mx_soundTrace_train_1'); load ('integral_p_1_round_train'); load ('net_ff') %load('validation'); %load('test'); input_400 = mx_soundTrace_train_1(1:400,1:end); clear mx_soundTrace_train_1; 8.A neurális háló tanítása %['netname',TR]=train('netname','input','output'); [net_ff,TR]=train(net_ff,input_400,integral_p_1_round_train); save('net_ff','net_ff') 9.Szimuláció output=sim(net_ff,input_400); % A referencia integrál értékek és a szimulált értékek összehasonlítása figure(1) plot (output); hold on; plot (integral_p_1_round_train); % A szimulált integrál értékek eltérése (hibája) a referencia értékekhez képest integral_error = (output - integral_p_1_round_train) ./ integral_p_1_round_train .* 100; figure(4) plot(integral_error) sum_error = sum(abs(integral_error)) / size(integral_error, 2) end
Nov 27, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here