Skip to content

Commit

Permalink
Merge branch 'master' into cyclicDistribution
Browse files Browse the repository at this point in the history
Conflicts:
	psmo/psmo_solver.cpp
  • Loading branch information
mricherzhagen committed Jul 29, 2014
2 parents 3ecc14f + d2b0a5d commit 5efeeb1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
4 changes: 0 additions & 4 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ apply to the parts of the LibSVM code, that is svm.h, svm.cpp,
pisvm-train.c pisvm-predict.c and pisvm-scale.c. All of the
pisvm-*.c files contain changes made to enable parallel training.

All of the svm_* files contain code extracted from the svm.cpp
file to increase readability and therefor the conditions in
COPYRIGHT-LibSVM also apply to these files.

All other source code, including the parallel LOQO solver in
subdirectory loqo and the parallel SMO solver in subdirectory
psmo is licensed under the terms of the GPL as given in LICENSE.txt
1 change: 1 addition & 0 deletions pisvm-predict.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,5 +330,6 @@ int main(int argc, char **argv)
free(nz_x);
fclose(input);
fclose(output);
MPI_Finalize();
return 0;
}
7 changes: 5 additions & 2 deletions pisvm-train.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,16 +244,19 @@ void parse_command_line(int argc, char **argv, char *input_file_name,

strcpy(input_file_name, argv[i]);

if(i<argc-1)
if(i == argc - 2) //There is exactly 1 additional parameter after the input file name
strcpy(model_file_name,argv[i+1]);
else
else if (i == argc - 1)//input file name is the last parameter
{
char *p = strrchr(argv[i],'/');
if(p==NULL)
p = argv[i];
else
++p;
sprintf(model_file_name,"%s.model",p);
} else { //There are more parameters
printf("ERROR: There are unparsed parameters!\n");
exit_with_help();
}
}

Expand Down
3 changes: 3 additions & 0 deletions psmo/psmo_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,8 @@ void Solver_Parallel_SMO::Solve(int l, const QMatrix& Q, const double *b_,
// const Qfloat *Q_i = Q.get_Q_subset(work_set[i],work_set,n);
if(Q.is_cached(work_set[i]))
{
//Q is_cached does not mean we can access the whole subset for free: it might happen, that only
// the not_work_subset is cached and all values have to be calculated!
const Qfloat *Q_i = Q.get_Q_subset(work_set[i],work_set,i+1);
for(int j=0; j<=i; ++j)
{
Expand Down Expand Up @@ -1026,6 +1028,7 @@ void Solver_Parallel_SMO::Solve(int l, const QMatrix& Q, const double *b_,
// First update the cached part...
for(int i=0; i<count_cached; ++i)
{
//Even if Q_i 'is_cached' does not mean the not_work_subset is cached. it might be the case, that only work_set is cached.
const Qfloat *Q_i = Q.get_Q_subset(work_set[idx_cached[i]],
not_work_set,lmn);
for(int j=0; j<lmn; ++j)
Expand Down
2 changes: 1 addition & 1 deletion svm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2889,7 +2889,7 @@ void svm_cross_validation(const svm_problem *prob, const svm_parameter *param,
subprob.nz_idx = Malloc(int *, subprob.l);
subprob.x_len = Malloc(int, subprob.l);
subprob.y = Malloc(double,subprob.l);

subprob.max_idx = prob->max_idx;
k=0;
for(j=0; j<begin; j++)
{
Expand Down

0 comments on commit 5efeeb1

Please sign in to comment.