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 2, 2018
1 parent 420617b commit 072b365
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/random_fourier_features.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ 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(log(1+exp(w[1:num_f,1:c]%*%t(x)+b[1:num_f,])));
feat = sqrt(2)*t(cos(w[1:num_f,1:c]%*%t(x)+b[1:num_f,]));
#feat = sqrt(2)*t(log(1+exp(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 072b365

Please sign in to comment.