Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose learning rate parameter #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/demo_stochastic_matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,17 @@ int main(int argc, char **argv)
// Shut GetOpt error messages down (return '?'):
opterr = 0;

while ( (opt = getopt(argc, argv, "l:d:a:m:e:h:p:")) != -1 ) {
while ( (opt = getopt(argc, argv, "l:d:a:m:e:h:p:r")) != -1 ) {
switch ( opt ) {
case 'l':
sscanf(optarg, "%lf", &params.lambda);
break;
case 'd':
params.d = atoi(optarg);
break;
case 'r':
sscanf(optarg, "%lf", &params.eta);
break;
case 'm':
params.maxIter = atoi(optarg);
break;
Expand Down
2 changes: 1 addition & 1 deletion src/gradient_descend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void kl_minimization(coord* y,
// ----- t-SNE hard coded parameters - Same as in vdM's code
int stop_lying_iter = params.earlyIter, mom_switch_iter = 250;
double momentum = .5, final_momentum = .8;
double eta = 200.0;
double eta = params.eta;
int iterPrint = 50;

double timeFattr = 0.0;
Expand Down
4 changes: 2 additions & 2 deletions src/sgtsne.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ typedef struct {
double h = -1; //!< Grid side length (accuracy control)
bool dropLeaf = false; //!< Drop edges originating from leaf nodes?
int np = 0; //!< Number of CILK workers (processes)

} tsneparams;
double eta = 200.0; //!< learning rate
} tsneparams;


//! Sparse matrix structure in CSC format
Expand Down
1 change: 1 addition & 0 deletions src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ void printParams(tsneparams P){
<< "Early exag. multiplier α: " << P.alpha << std::endl
<< "Maximum iterations: " << P.maxIter << std::endl
<< "Early exag. iterations: " << P.earlyIter << std::endl
<< "Learning rate: " << P.eta << std::endl
<< "Box side length h: " << P.h << std::endl
<< "Drop edges originating from leaf nodes? " << P.dropLeaf << std::endl
<< "Number of processes: " << P.np << std::endl;
Expand Down