-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathDemo_training_HSI_SDeCNN.m
executable file
·51 lines (40 loc) · 1.83 KB
/
Demo_training_HSI_SDeCNN.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
49
50
51
% This is the training demo of FFDNet for denoising hyperspectral noisy
% color images corrupted by AWGN.
%
% To run the code, you should install Matconvnet first. Alternatively, you can use the
% function `vl_ffdnet_matlab` to perform denoising without Matconvnet.
%
% HSI-SDeCNN: A Single Model CNN for Hyperspectral Image Denoising
clc, clear, close all;
format compact;
addpath(genpath('utilities'));
% run vl_setupnn in the MatConvNet directory
run /home/alex/matconvnet-1.0-beta25/matlab/vl_setupnn
%-------------------------------------------------------------------------
% Configuration
%-------------------------------------------------------------------------
opts.modelName = 'HSI_SDeCNN'; % model name
opts.learningRate = [logspace(-4,-4,100),logspace(-4,-4,100)/3,logspace(-4,-4,100)/(3^2),logspace(-4,-4,100)/(3^3),logspace(-4,-4,100)/(3^4)];% you can change the learning rate
opts.batchSize = 128; % default
opts.gpus = [1];
opts.numSubBatches = 1;
opts.weightDecay = 0.0005;
opts.expDir = fullfile('data', opts.modelName); %output directory
addpath(genpath('data'));
%-------------------------------------------------------------------------
% Initialize model
%-------------------------------------------------------------------------
net = feval(['model_init_',opts.modelName]);
%-------------------------------------------------------------------------
% Train
%-------------------------------------------------------------------------
tic
[net, info] = model_train(net, ...
'expDir', opts.expDir, ...
'learningRate',opts.learningRate, ...
'numSubBatches',opts.numSubBatches, ...
'weightDecay',opts.weightDecay, ...
'batchSize', opts.batchSize, ...
'modelname', opts.modelName, ...
'gpus',opts.gpus)
toc