Skip to content

Commit

Permalink
Minor tuning of the sampling
Browse files Browse the repository at this point in the history
  • Loading branch information
luav committed Feb 13, 2017
1 parent 7e9bd4b commit 497c86b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/calculate_till_tolerance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,10 @@ calculated_info_t calculate_till_tolerance(
if(sratio > 1)
sratio = 2 - 1 / sratio;
const size_t steps1 = sratio / 2 * steps;
#ifdef DEBUG
fprintf(stderr, "# rows/cols: %G, steps1: %lu, steps2: %lu, sr: %G\n", double(rows) / cols
, steps1, steps - steps1, steps1 / double(steps - steps1));
, steps - steps1, steps1, steps1 / double(steps - steps1));
#endif // DEBUG
while( epvar < max_var )
{
// For the number of steps randomly selected vertices fill the matrix of modules (clusters) correspondence
Expand Down
4 changes: 2 additions & 2 deletions src/deep_complete_simulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ struct deep_complete_simulator::pimpl_t {
{
result.importance = 1.0; // Probability E [0, 1]
// Get the sets of modules (from 2 clusterings/partitions) for the first vertex
size_t vertex = verts[lindis(rd)]; // 0
size_t vertex = verts[lindis(rndgen)]; // 0, rndgen, rd

module_set_t rm1, rm2;
get_modules( vertex, rm1, rm2 );
Expand Down Expand Up @@ -136,7 +136,7 @@ struct deep_complete_simulator::pimpl_t {
//vertex = verts[ iv2 ];

// Take modules from clustering 1 or 2 relevant to the origin vertex
const auto iv2 = lindis(rd);
const auto iv2 = lindis(rndgen); // rndgen, rd
bool v2first = iv2 % 2;
module_set_t v2bms = move(v2first ? rm1 : rm2); // Base modules for v2
// ATTENTION: a single selected module set can be empty
Expand Down

0 comments on commit 497c86b

Please sign in to comment.