randomrowspacedirection.m.svn-base

来自「a function inside machine learning」· SVN-BASE 代码 · 共 15 行

SVN-BASE
15
字号
function u = randomRowSpaceDirection(X, Y)
%A function to compute a vector with a random direction, but in the row
%space of X. The vector has norm 1;  
%
%inputs 
%X data matrix with examples as rows 
%Y labels matrix with output as rows 
%
%outputs 
%u the vector which maximises the emperical target alignment between X and Y 

alpha = rand(size(X, 1), 1)-0.5; 
u = X'*alpha; 

u = u/norm(u); 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?