diff --git a/rogueviz/kohonen.cpp b/rogueviz/kohonen.cpp index 605c59f9..686b36ab 100644 --- a/rogueviz/kohonen.cpp +++ b/rogueviz/kohonen.cpp @@ -40,7 +40,8 @@ struct neuron { int lpbak; color_t col; int allsamples, drawn_samples, csample, bestsample, max_group_here; - neuron() { drawn_samples = allsamples = bestsample = 0; max_group_here = max_group; } + int debug; + neuron() { drawn_samples = allsamples = bestsample = 0; max_group_here = max_group; debug = 0; } }; vector colnames; @@ -538,7 +539,8 @@ void buildcellcrawler(cell *c, cellcrawler& cr, int dir) { map scc; pair get_cellcrawler_id(cell *c) { - if(among(geometry, gZebraQuotient, gMinimal, gField435, gField534) || (euclid && quotient && !bounded) || IRREGULAR || (GDIM == 3 && sphere)) { + if(among(geometry, gZebraQuotient, gMinimal, gArnoldCat, gField435, gField534) || (euclid && quotient && !bounded) || IRREGULAR || (GDIM == 3 && sphere) || (hyperbolic && GDIM == 3 && quotient) + || (euclid && nonorientable)) { // Zebra Quotient does exhibit some symmetries, // but these are so small anyway that it is safer to just build // a crawler for every neuron @@ -679,6 +681,7 @@ void step() { for(auto& sd: s.data) { neuron *n2 = getNeuron(sd.target.at); if(!n2) continue; + n2->debug++; double nu = learning_factor; if(gaussian) { @@ -695,6 +698,11 @@ void step() { throw hr_exception("obtained nan somehow, nu = " + lalign(0, nu)); } } + + for(auto& n2: net) { + if(n2.debug > 1) throw hr_exception("sprawler error"); + n2.debug = 0; + } t--; if(t == 0) analyze(); @@ -791,8 +799,13 @@ vector gen_neuron_cells() { map clindex; for(int i=0; i