Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
Minor changes
  • Loading branch information
krzakala committed Aug 17, 2015
1 parent 5ee1c55 commit 0974570
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
LowRAMP: Low rank Approximate Message Passing, a software for low rank matrix factorization based on belief propagation.
LowRAMP: Low rank Approximate Message Passing, a MATLAB software for low rank matrix factorization based on belief propagation.
COPYRIGHT (C) 2015 Thibault Lesieur, Florent Krzakala and Lenka Zdeborova
Contact : [email protected]

Expand All @@ -21,7 +21,7 @@ USAGE : from matlab, includes the two subfolders Functions and Subroutines (for
path(path,'./Subroutines'); path(path,'./Functions');).

Then run
* demo demo_LowRAMP_UV for a UV factorization of a clustering problem
* demo_LowRAMP_UV for a UV factorization of a clustering problem
* demo_PCA_and_completion for a completion problem
* demo_LowRAMP_XX for a community detection problem
* demo_Rank1_Submatrix for a submatrix localization problem
Expand Down
6 changes: 3 additions & 3 deletions Subroutines/f_Rank1Binary.m
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
function [MEAN,VAR,logZ] = f_Rank1Binary(A,B,rho)
%Rank 1 0/1 prior
%rho is the a priori fraction of 1
%Rank 1 0/1 prior
%rho is the a priori fraction of 1
if (nargin <= 2)
rho=0.5; % Use default parameters
end
end
Weight=-0.5*A+B;
pos=find(Weight>0);
neg=setdiff([1:size(B,1)],pos);
Expand Down
15 changes: 10 additions & 5 deletions Subroutines/f_gauss.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
function [MEAN,VAR,logZ] = f_gauss(A,B)
VAR=inv(eye(size(A))+A);
MEAN=B*VAR;
logZ=trace(0.5*B'*B*VAR);
logZ=-0.5*log(det(eye(size(A))+A))*size(B,1)+logZ ;
function [MEAN,VAR,logZ] = f_gauss(A,B,var_gauss)
%Rank K Gaussian prior
%var_gauss is the a priori variance of the prior
if (nargin <= 2)
var_gauss=1; % Use default parameters
end
VAR=inv((1./var_gauss)*eye(size(A))+A);
MEAN=B*VAR;
logZ=trace(0.5*B'*B*VAR);
logZ=-0.5*log(det(var_gauss*eye(size(A))+A))*size(B,1)+logZ ;
end
2 changes: 0 additions & 2 deletions demo_PCA_and_completion.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
RANK=3;%rank
fprintf(1,'Creating a %dx%d signal of rank %d ...\n',m,n,RANK);

fprintf(1,'Creating a %dx%d signal of rank %d ...\n',m,n,RANK);

U = randn(m,RANK);
V = randn(n,RANK);

Expand Down

0 comments on commit 0974570

Please sign in to comment.