-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWave_RVFL_Main.m
More file actions
81 lines (65 loc) · 2.93 KB
/
Wave_RVFL_Main.m
File metadata and controls
81 lines (65 loc) · 2.93 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
%%
% Please cite the following paper if you are using this code.
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Reference %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% M. Sajid, A. Quadir, and M. Tanveer. "Wave-RVFL: A Randomized Neural Network Based on Wave Loss Function."
% Published in the 31st International Conference on Neural Information Processing (ICONIP) 2024.
% Arxiv Link: https://arxiv.org/abs/2408.02824
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The experimental hardware configuration includes a personal computer featuring
% an Intel(R) Xeon(R) Gold 6226R CPU with a clock speed of 2.90 GHz and
% 128 GB of RAM. The system runs on Windows 11 and utilizes Matlab2023a
% to run all the experiments.
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% We have put a demo code of the "Wave-RVFL" model with the "adult" dataset
%
% For the demo purpose, following hyperparameters set used for the experiment.
% To get the optimal results, please tune the hyperparameters.
% For the detailed experimental setup, please refer to the supplementary material of the paper.
%
% C=0.01;
% Number of Hidden Node=123;
% Act=3;
% Wave_a=4.5;
% Wave_b=1.6;
% Alpha=1;
% m=2^5;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
clc;
clear;
warning off all;
format compact;
%% Data Preparation
split_ratio=0.6; nFolds=5;
% addpath(genpath('C:\Users\HP\OneDrive - IIT Indore\Desktop\Wave-RVFL\Models\RVFL\Code\GitHub'))
temp_data1=load('adult.mat');
temp_data=temp_data1.adult;
[Cls,~,~] = unique(temp_data(:,end));
No_of_class = size(Cls,1);
trainX=temp_data(:,1:end-1); mean_X = mean(trainX,1); std_X = std(trainX);
trainX = bsxfun(@rdivide,trainX-repmat(mean_X,size(trainX,1),1),std_X);
All_Data=[trainX,temp_data(:,end)];
[samples,~]=size(All_Data);
rng('default')
test_start=floor(split_ratio*samples);
training_Data = All_Data(1:test_start-1,:); testing_Data = All_Data(test_start:end,:);
test_x=testing_Data(:,1:end-1); test_y=testing_Data(:,end);
train_x=training_Data(:,1:end-1); train_y=training_Data(:,end);
% option.C=0.0001;
% option.N=3;
% option.activation=3;
% option.a=-2;
% option.b=0.6;
% option.alpha=0.0001;
% option.m=length(training_Data);
option.C=0.0001;
option.N=203;
option.activation=5;
option.a=-1;
option.b=0.6;
option.alpha=0.0001;
option.m=2^8;
[EVAL_Train,EVAL_Test,train_time,valid_time] = Wave_RVFL_Model(train_x,train_y,test_x,test_y,option);
% fprintf(1, 'Testing Accuracy of Wave-RVFL model is: %f\n', EVAL_Test(1,1));