Permalink
Browse files

modified dpm so that it can actually train mixture model

  • Loading branch information...
1 parent 4775517 commit a131f6ae1fa3362df5c4d91d1f160e5e2fecaf32 @liuliu committed Sep 28, 2012
Showing with 466 additions and 223 deletions.
  1. +17 −11 bin/dpmcreate.c
  2. +1 −0 lib/ccv.h
  3. +448 −212 lib/ccv_dpm.c
View
@@ -18,8 +18,9 @@ void exit_with_help()
" \033[1mOTHER OPTIONS\033[0m\n\n"
" --base-dir : change the base directory so that the program can read images from there\n"
" --iterations : how many iterations are needed for stochastic gradient descent [DEFAULT TO 1000]\n"
+ " --root-relabels : how many relabel procedures are needed for root model optimization [DEFAULT TO 20]\n"
" --data-minings : how many data mining procedures are needed for discovering hard examples [DEFAULT TO 100]\n"
- " --relabels : how many relabel procedures are needed [DEFAULT TO 5]\n"
+ " --relabels : how many relabel procedures are needed for part model optimization [DEFAULT TO 10]\n"
" --alpha : the step size for stochastic gradient descent [DEFAULT TO 0.01]\n"
" --alpha-ratio : decrease the step size for each iteration [DEFAULT TO 0.995]\n"
" --margin-c : the famous C in SVM [DEFAULT TO 0.002]\n"
@@ -48,6 +49,7 @@ int main(int argc, char** argv)
/* optional parameters */
{"base-dir", 1, 0, 0},
{"iterations", 1, 0, 0},
+ {"root-relabels", 1, 0, 0},
{"data-minings", 1, 0, 0},
{"relabels", 1, 0, 0},
{"alpha", 1, 0, 0},
@@ -77,7 +79,8 @@ int main(int argc, char** argv)
.alpha_ratio = 0.995,
.iterations = 1000,
.data_minings = 100,
- .relabels = 5,
+ .root_relabels = 20,
+ .relabels = 10,
.negative_cache_size = 2000,
.C = 0.002,
.percentile_breakdown = 0.05,
@@ -118,32 +121,35 @@ int main(int argc, char** argv)
params.iterations = atoi(optarg);
break;
case 10:
- params.data_minings = atoi(optarg);
+ params.root_relabels = atoi(optarg);
+ break;
case 11:
+ params.data_minings = atoi(optarg);
+ case 12:
params.relabels = atoi(optarg);
break;
- case 12:
+ case 13:
params.alpha = atof(optarg);
break;
- case 13:
+ case 14:
params.alpha_ratio = atof(optarg);
break;
- case 14:
+ case 15:
params.balance = atof(optarg);
break;
- case 15:
+ case 16:
params.negative_cache_size = atoi(optarg);
break;
- case 16:
+ case 17:
params.C = atof(optarg);
break;
- case 17:
+ case 18:
params.percentile_breakdown = atof(optarg);
break;
- case 18:
+ case 19:
params.include_overlap = atof(optarg);
break;
- case 19:
+ case 20:
params.grayscale = !!atoi(optarg);
break;
}
View
@@ -697,6 +697,7 @@ typedef struct {
int max_area; // 5000
int iterations;
int data_minings;
+ int root_relabels;
int relabels;
int negative_cache_size; // 1000
double include_overlap; // 0.7
Oops, something went wrong.

0 comments on commit a131f6a

Please sign in to comment.