-
Notifications
You must be signed in to change notification settings - Fork 3
/
Demo_Train_FracDCNN_DAG.m
48 lines (37 loc) · 1.5 KB
/
Demo_Train_FracDCNN_DAG.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
clear;
rng('default')
addpath('utilities');
%-------------------------------------------------------------------------
% Configuration
%-------------------------------------------------------------------------
opts.learningRate = [logspace(-3,-3,45) logspace(-3.5,-4,45)];% you can change the learning rate
opts.batchSize = 8; %
opts.gpus = [1];
opts.numSubBatches = 1;
% solver
opts.solver = 'Adam'; % global
opts.derOutputs = {'objective',1} ;
opts.backPropDepth = Inf;
%-------------------------------------------------------------------------
% Initialize model
%-------------------------------------------------------------------------
global CurTask;
CurTask = 'Denoising'; %% 'Deblocking' and 'SISR'
opts.sigma = 50;
% CurTask = 'SISR'; opts.sigma = 2;
opts.modelName = ['FracDCNN' CurTask num2str(opts.sigma)];% model name
% net = feval(['FracDCNN','_Init']);
net = feval(['FracDCNN']);
%-------------------------------------------------------------------------
% Train
%-------------------------------------------------------------------------
[net] = FracDCNN_train_dag(net, ...
'learningRate',opts.learningRate, ...
'derOutputs',opts.derOutputs, ...
'numSubBatches',opts.numSubBatches, ...
'backPropDepth',opts.backPropDepth, ...
'solver',opts.solver, ...
'batchSize', opts.batchSize, ...
'modelname', opts.modelName, ...
'sigma', opts.sigma, ...
'gpus',opts.gpus) ;