资源简介
神经网络导论课程实验1代码, Adaline的LMS算法(matlab)
代码片段和文件信息
%%2017-12-18
%%Adaline-LMS
clear;
clc;
train_Data = load(“lms_samp.mat“);
test_Data = load(“lms_tstsamp.mat“);
%samp_Data.samp
%scatter(train_Data.samp(:1)train_Data.samp(:2)‘k‘);
%%%% train data
x1_train = train_Data.samp(:1);
x2_train = train_Data.samp(:2);
train_lable = train_Data.samp(:3);
%%%% test data
x1_test = test_Data.tstsamp(:1);
x2_test = test_Data.tstsamp(:2);
test_lable = test_Data.tstsamp(:3);
length_data = length(test_lable);
%%% LMS算法求出自相关矩阵R和互相关向量P
Th =ones(length(x1_train)1)
X_train = [x1_trainx2_trainTh];
R = (X_train‘* X_train)./length(x1_train); %% 自相关矩阵R
P = train_lable‘*X_train./length(x1_train); %% 互相关向量P
W = P*inv(R); %% 计算最优的W
% Error_train = ((train_lable-Y_train)‘*(train_lable-Y_train))/length_data;%% 训练误差
Error_min
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2514 2017-12-21 14:08 adaline_LMS.m
文件 2714 2017-12-21 15:36 adaline_LMS_random.m
文件 4984 2009-11-29 14:28 lms_samp.mat
文件 3430 2010-09-19 16:53 lms_tstsamp.mat
文件 383 2017-12-19 10:33 randomselect.m
- 上一篇:DOA算法中的bartlett算法研究
- 下一篇:双树复小波程序[MATLAB]
评论
共有 条评论