赞
踩
电力系统的安全稳定运行与国民经济的发展及社会人身财产安全息息相关.准确的短期负荷预测结果是电网指导电力系统制定发电计划,协调机组运行,调度负荷分配及制定检修计划的重要依据.随着智能电网的发展及越来越多的分布式电源的接入,影响短期负荷预测结果的因素更加复杂,使负荷呈现更强的非线性,这种严峻的环境也对短期负荷预测的准确度和适应性提出了更高的要求.电力系统的负荷由于数据量庞大,受众多因素影响等使其具有随机性,非线性,时序性等特点.卷积神经网络(Convolutional Neural Networks,CNN)能够深入挖掘信息的多重特点并从中获得有用的特征描述,是一种准确高效的特征提取方法.本文结合负荷序列的特点,使用CNN来对电力系统短期负荷进行预测。
clc, clearvars, close all
%------------------------------------------------------------------------------------------------
function X_aug = image_augmentation(Xdata,aug_params)
%Randomly augment images slice-by-slice between given ranges, optionally add Gaussian noise:
X_aug = zeros(size(Xdata));
imageAugmenter = imageDataAugmenter( ...
'RandRotation',aug_params.rot, ...
'RandXTranslation',aug_params.trans_x, ...
'RandYTranslation',aug_params.trans_y, ...
'RandXReflection', aug_params.refl_x, ...
'RandYReflection', aug_params.refl_y, ...
'RandScale', aug_params.scale, ...
'RandXShear', aug_params.shear_x, ...
'RandYShear', aug_params.shear_y);
for i = 1:size(Xdata,4)
Xtrain_single = Xdata(:,:,:,i);
Xtrain_single_aug = augment(imageAugmenter,Xtrain_single);
if aug_params.add_gauss_noise == 1
Xtrain_single_aug = imnoise(Xtrain_single_aug,'gaussian',0,aug_params.gauss_noise_var);
end
电力系统的安全稳定运行与国民经济的发展及社会人身财产安全息息相关.准确的短期负荷预测结果是电网指导电力系统制定发电计划,协调机组运行,调度负荷分配及制定检修计划的重要依据.随着智能电网的发展及越来越多的分布式电源的接入,影响短期负荷预测结果的因素更加复杂,使负荷呈现更强的非线性,这种严峻的环境也对短期负荷预测的准确度和适应性提出了更高的要求.电力系统的负荷由于数据量庞大,受众多因素影响等使其具有随机性,非线性,时序性等特点.卷积神经网络(Convolutional Neural Networks,CNN)能够深入挖掘信息的多重特点并从中获得有用的特征描述,是一种准确高效的特征提取方法.本文结合负荷序列的特点,使用CNN来对电力系统短期负荷进行预测。
clc, clearvars, close all
%------------------------------------------------------------------------------------------------
function X_aug = image_augmentation(Xdata,aug_params)
%Randomly augment images slice-by-slice between given ranges, optionally add Gaussian noise:
X_aug = zeros(size(Xdata));
imageAugmenter = imageDataAugmenter( ...
'RandRotation',aug_params.rot, ...
'RandXTranslation',aug_params.trans_x, ...
'RandYTranslation',aug_params.trans_y, ...
'RandXReflection', aug_params.refl_x, ...
'RandYReflection', aug_params.refl_y, ...
'RandScale', aug_params.scale, ...
'RandXShear', aug_params.shear_x, ...
'RandYShear', aug_params.shear_y);
for i = 1:size(Xdata,4)
Xtrain_single = Xdata(:,:,:,i);
Xtrain_single_aug = augment(imageAugmenter,Xtrain_single);
if aug_params.add_gauss_noise == 1
Xtrain_single_aug = imnoise(Xtrain_single_aug,'gaussian',0,aug_params.gauss_noise_var);
end
X_aug(:,:,:,i) = Xtrain_single_aug;
end
%%%%% Deep learning convolutional neural network regression v1.1 %%%%%
% With network parameter gridsearch, input normalization and geometric image augmenation:
function [X_equal,Y_equal] = ROS(Xdata,Ydata,duplication_factor)
%Equalize output (Ydata) distribution using random oversampling:
[Ydata_counts, Ydata_bins] = histcounts(Ydata);
Ydata_max_count = max(Ydata_counts);
Ydata_max_count_ratio = floor(Ydata_max_count*(1./Ydata_counts));
Ydata_max_count_ratio = Ydata_max_count*(1./Ydata_counts);
Ydata_max_count_ratio_norm = Ydata_max_count_ratio/sum(Ydata_max_count_ratio);
for i = 1:numel(Ydata)
Ydata_bins_temp = Ydata_bins(1:end-1);
Ydata_bins_temp(Ydata_bins_temp > Ydata(i)) = 0;
[~,Ydata_bin_idx] = max(Ydata_bins_temp);
Ydata_prob(i,1) = Ydata_max_count_ratio_norm(Ydata_bin_idx);
end
ROS_selection = randsample(numel(Ydata),numel(Ydata)*duplication_factor,true,Ydata_prob(:,1));
Y_equal = Ydata(ROS_selection);
X_equal = Xdata(:,:,:,ROS_selection);
%For testing, to view original and randomly oversampled input histogram:
%{
figure()
histogram(Ydata,Ydata_bins)
xlabel('RBC content (%)')
ylabel('Count')
figure()
histogram(Y_equal,Ydata_bins)
xlabel('RBC content (%)')
ylabel('Count')
%}
;
disp(['Network accuracy: ', num2str(results_test.accuracy_test)])
disp(['Network absolute error: ', num2str(results_test.error_abs_test)])
disp(['Network RMSE: ', num2str(results_test.rmse_test)])
%Plot display predicted against true Y values for test set images:
linear_fit = polyfit(YTest,results_test.predicted_test,1);
x_space = linspace(0,0.6);
y_fit = polyval(linear_fit,x_space);
y_space = x_space;
dlm = fitlm(YTest,results_test.predicted_test,'Intercept',false);
figure()
hold on
plot(YTest,'r-');hold on
plot(results_test.predicted_test,'b-')
xlabel('时间')
ylabel('值')
legend('真实值','预测值')
figure()
hold on
scatter(YTest,results_test.predicted_test)
plot(x_space,y_fit)
plot(x_space,y_space,'k--')
hold off
title('Network test set predictions')
xlabel('True Y value')
ylabel('Predicted Y value')
axis([0 0.6 0 0.6])
function options = network_options(params,XVal,YVal,show_plots)
if strcmp(params.optimizer,'sgdm') && show_plots == 1
options = trainingOptions(params.optimizer, ...
'MiniBatchSize',params.batch_size, ...
'MaxEpochs',params.max_epochs, ...
'InitialLearnRate',params.learn_rate, ...
'LearnRateSchedule',params.learn_rate_schedule, ...
'LearnRateDropFactor',params.learn_rate_drop_factor, ...
'LearnRateDropPeriod',params.learn_rate_drop_period, ...
'Shuffle',params.shuffle, ...
'L2Regularization',params.L2_reg, ...
'ValidationData',{XVal,YVal}, ...
'ValidationFrequency',params.validationFrequency, ...
'Plots','training-progress', ...
'Momentum',params.momentum, ...
'Verbose',false);
elseif strcmp(params.optimizer,'sgdm') && show_plots == 0
options = trainingOptions(params.optimizer, ...
'MiniBatchSize',params.batch_size, ...
'MaxEpochs',params.max_epochs, ...
'InitialLearnRate',params.learn_rate, ...
'LearnRateSchedule',params.learn_rate_schedule, ...
'LearnRateDropFactor',params.learn_rate_drop_factor, ...
'LearnRateDropPeriod',params.learn_rate_drop_period, ...
'Shuffle',params.shuffle, ...
'L2Regularization',params.L2_reg, ...
'ValidationData',{XVal,YVal}, ...
'ValidationFrequency',params.validationFrequency, ...
'Momentum',params.momentum, ...
'Verbose',false);
elseif strcmp(params.optimizer,'adam') && show_plots == 1
options = trainingOptions(params.optimizer, ...
'MiniBatchSize',params.batch_size, ...
'MaxEpochs',params.max_epochs, ...
'InitialLearnRate',params.learn_rate, ...
'LearnRateSchedule',params.learn_rate_schedule, ...
'LearnRateDropFactor',params.learn_rate_drop_factor, ...
'LearnRateDropPeriod',params.learn_rate_drop_period, ...
'Shuffle',params.shuffle, ...
'L2Regularization',params.L2_reg, ...
'ValidationData',{XVal,YVal}, ...
'ValidationFrequency',params.validationFrequency, ...
'Plots','training-progress', ...
'Verbose',false);
elseif strcmp(params.optimizer,'adam') && show_plots == 0
options = trainingOptions(params.optimizer, ...
'MiniBatchSize',params.batch_size, ...
'MaxEpochs',params.max_epochs, ...
'InitialLearnRate',params.learn_rate, ...
'LearnRateSchedule',params.learn_rate_schedule, ...
'LearnRateDropFactor',params.learn_rate_drop_factor, ...
'LearnRateDropPeriod',params.learn_rate_drop_period, ...
'Shuffle',params.shuffle, ...
'L2Regularization',params.L2_reg, ...
'ValidationData',{XVal,YVal}, ...
'ValidationFrequency',params.validationFrequency, ...
'Verbose',false);
else
disp('Model parameters not defined!')
end
function X_aug = image_augmentation(Xdata,aug_params)
%Randomly augment images slice-by-slice between given ranges, optionally add Gaussian noise:
X_aug = zeros(size(Xdata));
imageAugmenter = imageDataAugmenter( ...
'RandRotation',aug_params.rot, ...
'RandXTranslation',aug_params.trans_x, ...
'RandYTranslation',aug_params.trans_y, ...
'RandXReflection', aug_params.refl_x, ...
'RandYReflection', aug_params.refl_y, ...
'RandScale', aug_params.scale, ...
'RandXShear', aug_params.shear_x, ...
'RandYShear', aug_params.shear_y);
for i = 1:size(Xdata,4)
Xtrain_single = Xdata(:,:,:,i);
Xtrain_single_aug = augment(imageAugmenter,Xtrain_single);
if aug_params.add_gauss_noise == 1
Xtrain_single_aug = imnoise(Xtrain_single_aug,'gaussian',0,aug_params.gauss_noise_var);
end
X_aug(:,:,:,i) = Xtrain_single_aug;
end
[1]闫康. 基于卷积神经网络和灰色模型的轴承健康评估及预测研究.
部分理论引用网络文献,若有侵权联系博主删除。
电力系统的安全稳定运行与国民经济的发展及社会人身财产安全息息相关.准确的短期负荷预测结果是电网指导电力系统制定发电计划,协调机组运行,调度负荷分配及制定检修计划的重要依据.随着智能电网的发展及越来越多的分布式电源的接入,影响短期负荷预测结果的因素更加复杂,使负荷呈现更强的非线性,这种严峻的环境也对短期负荷预测的准确度和适应性提出了更高的要求.电力系统的负荷由于数据量庞大,受众多因素影响等使其具有随机性,非线性,时序性等特点.卷积神经网络(Convolutional Neural Networks,CNN)能够深入挖掘信息的多重特点并从中获得有用的特征描述,是一种准确高效的特征提取方法.本文结合负荷序列的特点,使用CNN来对电力系统短期负荷进行预测。
clc, clearvars, close all
%------------------------------------------------------------------------------------------------
function X_aug = image_augmentation(Xdata,aug_params)
%Randomly augment images slice-by-slice between given ranges, optionally add Gaussian noise:
X_aug = zeros(size(Xdata));
imageAugmenter = imageDataAugmenter( ...
'RandRotation',aug_params.rot, ...
'RandXTranslation',aug_params.trans_x, ...
'RandYTranslation',aug_params.trans_y, ...
'RandXReflection', aug_params.refl_x, ...
'RandYReflection', aug_params.refl_y, ...
'RandScale', aug_params.scale, ...
'RandXShear', aug_params.shear_x, ...
'RandYShear', aug_params.shear_y);
for i = 1:size(Xdata,4)
Xtrain_single = Xdata(:,:,:,i);
Xtrain_single_aug = augment(imageAugmenter,Xtrain_single);
if aug_params.add_gauss_noise == 1
Xtrain_single_aug = imnoise(Xtrain_single_aug,'gaussian',0,aug_params.gauss_noise_var);
end
X_aug(:,:,:,i) = Xtrain_single_aug;
end
%%%%% Deep learning convolutional neural network regression v1.1 %%%%%
% With network parameter gridsearch, input normalization and geometric image augmenation:
function [X_equal,Y_equal] = ROS(Xdata,Ydata,duplication_factor)
%Equalize output (Ydata) distribution using random oversampling:
[Ydata_counts, Ydata_bins] = histcounts(Ydata);
Ydata_max_count = max(Ydata_counts);
Ydata_max_count_ratio = floor(Ydata_max_count*(1./Ydata_counts));
Ydata_max_count_ratio = Ydata_max_count*(1./Ydata_counts);
Ydata_max_count_ratio_norm = Ydata_max_count_ratio/sum(Ydata_max_count_ratio);
for i = 1:numel(Ydata)
Ydata_bins_temp = Ydata_bins(1:end-1);
Ydata_bins_temp(Ydata_bins_temp > Ydata(i)) = 0;
[~,Ydata_bin_idx] = max(Ydata_bins_temp);
Ydata_prob(i,1) = Ydata_max_count_ratio_norm(Ydata_bin_idx);
end
ROS_selection = randsample(numel(Ydata),numel(Ydata)*duplication_factor,true,Ydata_prob(:,1));
Y_equal = Ydata(ROS_selection);
X_equal = Xdata(:,:,:,ROS_selection);
%For testing, to view original and randomly oversampled input histogram:
%{
figure()
histogram(Ydata,Ydata_bins)
xlabel('RBC content (%)')
ylabel('Count')
figure()
histogram(Y_equal,Ydata_bins)
xlabel('RBC content (%)')
ylabel('Count')
%}
;
disp(['Network accuracy: ', num2str(results_test.accuracy_test)])
disp(['Network absolute error: ', num2str(results_test.error_abs_test)])
disp(['Network RMSE: ', num2str(results_test.rmse_test)])
%Plot display predicted against true Y values for test set images:
linear_fit = polyfit(YTest,results_test.predicted_test,1);
x_space = linspace(0,0.6);
y_fit = polyval(linear_fit,x_space);
y_space = x_space;
dlm = fitlm(YTest,results_test.predicted_test,'Intercept',false);
figure()
hold on
plot(YTest,'r-');hold on
plot(results_test.predicted_test,'b-')
xlabel('时间')
ylabel('值')
legend('真实值','预测值')
figure()
hold on
scatter(YTest,results_test.predicted_test)
plot(x_space,y_fit)
plot(x_space,y_space,'k--')
hold off
title('Network test set predictions')
xlabel('True Y value')
ylabel('Predicted Y value')
axis([0 0.6 0 0.6])
function options = network_options(params,XVal,YVal,show_plots)
if strcmp(params.optimizer,'sgdm') && show_plots == 1
options = trainingOptions(params.optimizer, ...
'MiniBatchSize',params.batch_size, ...
'MaxEpochs',params.max_epochs, ...
'InitialLearnRate',params.learn_rate, ...
'LearnRateSchedule',params.learn_rate_schedule, ...
'LearnRateDropFactor',params.learn_rate_drop_factor, ...
'LearnRateDropPeriod',params.learn_rate_drop_period, ...
'Shuffle',params.shuffle, ...
'L2Regularization',params.L2_reg, ...
'ValidationData',{XVal,YVal}, ...
'ValidationFrequency',params.validationFrequency, ...
'Plots','training-progress', ...
'Momentum',params.momentum, ...
'Verbose',false);
elseif strcmp(params.optimizer,'sgdm') && show_plots == 0
options = trainingOptions(params.optimizer, ...
'MiniBatchSize',params.batch_size, ...
'MaxEpochs',params.max_epochs, ...
'InitialLearnRate',params.learn_rate, ...
'LearnRateSchedule',params.learn_rate_schedule, ...
'LearnRateDropFactor',params.learn_rate_drop_factor, ...
'LearnRateDropPeriod',params.learn_rate_drop_period, ...
'Shuffle',params.shuffle, ...
'L2Regularization',params.L2_reg, ...
'ValidationData',{XVal,YVal}, ...
'ValidationFrequency',params.validationFrequency, ...
'Momentum',params.momentum, ...
'Verbose',false);
elseif strcmp(params.optimizer,'adam') && show_plots == 1
options = trainingOptions(params.optimizer, ...
'MiniBatchSize',params.batch_size, ...
'MaxEpochs',params.max_epochs, ...
'InitialLearnRate',params.learn_rate, ...
'LearnRateSchedule',params.learn_rate_schedule, ...
'LearnRateDropFactor',params.learn_rate_drop_factor, ...
'LearnRateDropPeriod',params.learn_rate_drop_period, ...
'Shuffle',params.shuffle, ...
'L2Regularization',params.L2_reg, ...
'ValidationData',{XVal,YVal}, ...
'ValidationFrequency',params.validationFrequency, ...
'Plots','training-progress', ...
'Verbose',false);
elseif strcmp(params.optimizer,'adam') && show_plots == 0
options = trainingOptions(params.optimizer, ...
'MiniBatchSize',params.batch_size, ...
'MaxEpochs',params.max_epochs, ...
'InitialLearnRate',params.learn_rate, ...
'LearnRateSchedule',params.learn_rate_schedule, ...
'LearnRateDropFactor',params.learn_rate_drop_factor, ...
'LearnRateDropPeriod',params.learn_rate_drop_period, ...
'Shuffle',params.shuffle, ...
'L2Regularization',params.L2_reg, ...
'ValidationData',{XVal,YVal}, ...
'ValidationFrequency',params.validationFrequency, ...
'Verbose',false);
else
disp('Model parameters not defined!')
end
function X_aug = image_augmentation(Xdata,aug_params)
%Randomly augment images slice-by-slice between given ranges, optionally add Gaussian noise:
X_aug = zeros(size(Xdata));
imageAugmenter = imageDataAugmenter( ...
'RandRotation',aug_params.rot, ...
'RandXTranslation',aug_params.trans_x, ...
'RandYTranslation',aug_params.trans_y, ...
'RandXReflection', aug_params.refl_x, ...
'RandYReflection', aug_params.refl_y, ...
'RandScale', aug_params.scale, ...
'RandXShear', aug_params.shear_x, ...
'RandYShear', aug_params.shear_y);
for i = 1:size(Xdata,4)
Xtrain_single = Xdata(:,:,:,i);
Xtrain_single_aug = augment(imageAugmenter,Xtrain_single);
if aug_params.add_gauss_noise == 1
Xtrain_single_aug = imnoise(Xtrain_single_aug,'gaussian',0,aug_params.gauss_noise_var);
end
X_aug(:,:,:,i) = Xtrain_single_aug;
end
[1]闫康. 基于卷积神经网络和灰色模型的轴承健康评估及预测研究.
部分理论引用网络文献,若有侵权联系博主删除。
X_aug(:,:,:,i) = Xtrain_single_aug;
end
%%%%% Deep learning convolutional neural network regression v1.1 %%%%%
% With network parameter gridsearch, input normalization and geometric image augmenation:
function [X_equal,Y_equal] = ROS(Xdata,Ydata,duplication_factor)
%Equalize output (Ydata) distribution using random oversampling:
[Ydata_counts, Ydata_bins] = histcounts(Ydata);
Ydata_max_count = max(Ydata_counts);
Ydata_max_count_ratio = floor(Ydata_max_count*(1./Ydata_counts));
Ydata_max_count_ratio = Ydata_max_count*(1./Ydata_counts);
Ydata_max_count_ratio_norm = Ydata_max_count_ratio/sum(Ydata_max_count_ratio);
for i = 1:numel(Ydata)
Ydata_bins_temp = Ydata_bins(1:end-1);
Ydata_bins_temp(Ydata_bins_temp > Ydata(i)) = 0;
[~,Ydata_bin_idx] = max(Ydata_bins_temp);
Ydata_prob(i,1) = Ydata_max_count_ratio_norm(Ydata_bin_idx);
end
ROS_selection = randsample(numel(Ydata),numel(Ydata)*duplication_factor,true,Ydata_prob(:,1));
Y_equal = Ydata(ROS_selection);
X_equal = Xdata(:,:,:,ROS_selection);
%For testing, to view original and randomly oversampled input histogram:
%{
figure()
histogram(Ydata,Ydata_bins)
xlabel('RBC content (%)')
ylabel('Count')
figure()
histogram(Y_equal,Ydata_bins)
xlabel('RBC content (%)')
ylabel('Count')
%}
;
disp(['Network accuracy: ', num2str(results_test.accuracy_test)])
disp(['Network absolute error: ', num2str(results_test.error_abs_test)])
disp(['Network RMSE: ', num2str(results_test.rmse_test)])
%Plot display predicted against true Y values for test set images:
linear_fit = polyfit(YTest,results_test.predicted_test,1);
x_space = linspace(0,0.6);
y_fit = polyval(linear_fit,x_space);
y_space = x_space;
dlm = fitlm(YTest,results_test.predicted_test,'Intercept',false);
figure()
hold on
plot(YTest,'r-');hold on
plot(results_test.predicted_test,'b-')
xlabel('时间')
ylabel('值')
legend('真实值','预测值')
figure()
hold on
scatter(YTest,results_test.predicted_test)
plot(x_space,y_fit)
plot(x_space,y_space,'k--')
hold off
title('Network test set predictions')
xlabel('True Y value')
ylabel('Predicted Y value')
axis([0 0.6 0 0.6])
function options = network_options(params,XVal,YVal,show_plots)
if strcmp(params.optimizer,'sgdm') && show_plots == 1
options = trainingOptions(params.optimizer, ...
'MiniBatchSize',params.batch_size, ...
'MaxEpochs',params.max_epochs, ...
'InitialLearnRate',params.learn_rate, ...
'LearnRateSchedule',params.learn_rate_schedule, ...
'LearnRateDropFactor',params.learn_rate_drop_factor, ...
'LearnRateDropPeriod',params.learn_rate_drop_period, ...
'Shuffle',params.shuffle, ...
'L2Regularization',params.L2_reg, ...
'ValidationData',{XVal,YVal}, ...
'ValidationFrequency',params.validationFrequency, ...
'Plots','training-progress', ...
'Momentum',params.momentum, ...
'Verbose',false);
elseif strcmp(params.optimizer,'sgdm') && show_plots == 0
options = trainingOptions(params.optimizer, ...
'MiniBatchSize',params.batch_size, ...
'MaxEpochs',params.max_epochs, ...
'InitialLearnRate',params.learn_rate, ...
'LearnRateSchedule',params.learn_rate_schedule, ...
'LearnRateDropFactor',params.learn_rate_drop_factor, ...
'LearnRateDropPeriod',params.learn_rate_drop_period, ...
'Shuffle',params.shuffle, ...
'L2Regularization',params.L2_reg, ...
'ValidationData',{XVal,YVal}, ...
'ValidationFrequency',params.validationFrequency, ...
'Momentum',params.momentum, ...
'Verbose',false);
elseif strcmp(params.optimizer,'adam') && show_plots == 1
options = trainingOptions(params.optimizer, ...
'MiniBatchSize',params.batch_size, ...
'MaxEpochs',params.max_epochs, ...
'InitialLearnRate',params.learn_rate, ...
'LearnRateSchedule',params.learn_rate_schedule, ...
'LearnRateDropFactor',params.learn_rate_drop_factor, ...
'LearnRateDropPeriod',params.learn_rate_drop_period, ...
'Shuffle',params.shuffle, ...
'L2Regularization',params.L2_reg, ...
'ValidationData',{XVal,YVal}, ...
'ValidationFrequency',params.validationFrequency, ...
'Plots','training-progress', ...
'Verbose',false);
elseif strcmp(params.optimizer,'adam') && show_plots == 0
options = trainingOptions(params.optimizer, ...
'MiniBatchSize',params.batch_size, ...
'MaxEpochs',params.max_epochs, ...
'InitialLearnRate',params.learn_rate, ...
'LearnRateSchedule',params.learn_rate_schedule, ...
'LearnRateDropFactor',params.learn_rate_drop_factor, ...
'LearnRateDropPeriod',params.learn_rate_drop_period, ...
'Shuffle',params.shuffle, ...
'L2Regularization',params.L2_reg, ...
'ValidationData',{XVal,YVal}, ...
'ValidationFrequency',params.validationFrequency, ...
'Verbose',false);
else
disp('Model parameters not defined!')
end
function X_aug = image_augmentation(Xdata,aug_params)
%Randomly augment images slice-by-slice between given ranges, optionally add Gaussian noise:
X_aug = zeros(size(Xdata));
imageAugmenter = imageDataAugmenter( ...
'RandRotation',aug_params.rot, ...
'RandXTranslation',aug_params.trans_x, ...
'RandYTranslation',aug_params.trans_y, ...
'RandXReflection', aug_params.refl_x, ...
'RandYReflection', aug_params.refl_y, ...
'RandScale', aug_params.scale, ...
'RandXShear', aug_params.shear_x, ...
'RandYShear', aug_params.shear_y);
for i = 1:size(Xdata,4)
Xtrain_single = Xdata(:,:,:,i);
Xtrain_single_aug = augment(imageAugmenter,Xtrain_single);
if aug_params.add_gauss_noise == 1
Xtrain_single_aug = imnoise(Xtrain_single_aug,'gaussian',0,aug_params.gauss_noise_var);
end
X_aug(:,:,:,i) = Xtrain_single_aug;
end
[1]闫康. 基于卷积神经网络和灰色模型的轴承健康评估及预测研究.
部分理论引用网络文献,若有侵权联系博主删除。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。