Skip to content

Commit

Permalink
Update random_fourier_features.R
Browse files Browse the repository at this point in the history
  • Loading branch information
ericstrobl committed Sep 1, 2018
1 parent 7f95f84 commit 0d27ef3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/random_fourier_features.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ random_fourier_features <- function(x,w=NULL,b=NULL,num_f=NULL,sigma=NULL,seed=N
#w=rbind(w,(1/sigma)*matrix(rnorm((num_f-nrow(w))*c),num_f-nrow(w),c));
#b=rbind(b,repmat(2*pi*runif(num_f-nrow(b)),1,r));
#}
feat = sqrt(2)*t(cos(w[1:num_f,1:c]%*%t(x)+b[1:num_f,]));
feat = sqrt(2)*t(tanh(w[1:num_f,1:c]%*%t(x)+b[1:num_f,]));

out=list(feat=feat,w=w,b=b);
return(out)
Expand Down

0 comments on commit 0d27ef3

Please sign in to comment.