mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-11-26 02:14:48 +00:00
rogueviz:: som:: some missing initialization
This commit is contained in:
@@ -877,6 +877,7 @@ void initialize_samples_to_show() {
|
|||||||
vdata.emplace_back();
|
vdata.emplace_back();
|
||||||
auto &vd = vdata.back();
|
auto &vd = vdata.back();
|
||||||
vd.name = data[s].name;
|
vd.name = data[s].name;
|
||||||
|
labeler[data[s].name] = vdid;
|
||||||
vd.cp = dftcolor;
|
vd.cp = dftcolor;
|
||||||
createViz(vdid, cwt.at, Id);
|
createViz(vdid, cwt.at, Id);
|
||||||
storeall(vdid);
|
storeall(vdid);
|
||||||
@@ -936,6 +937,7 @@ void describe_cell(cell *c) {
|
|||||||
h += ", u-matrix = " + fts(n->udist);
|
h += ", u-matrix = " + fts(n->udist);
|
||||||
h += "\n";
|
h += "\n";
|
||||||
vector<pair<double, int>> v;
|
vector<pair<double, int>> v;
|
||||||
|
if(!whowon.empty())
|
||||||
for(int s=0; s<samples; s++) if(whowon[s] == n) v.emplace_back(vnorm(n->net, data[s].val), s);
|
for(int s=0; s<samples; s++) if(whowon[s] == n) v.emplace_back(vnorm(n->net, data[s].val), s);
|
||||||
for(int i=1; i<isize(v); i++) swap(v[i], v[rand() % (i+1)]);
|
for(int i=1; i<isize(v); i++) swap(v[i], v[rand() % (i+1)]);
|
||||||
sort(v.begin(), v.end(), [] (pair<double,int> a, pair<double,int> b) { return a.first < b.first; });
|
sort(v.begin(), v.end(), [] (pair<double,int> a, pair<double,int> b) { return a.first < b.first; });
|
||||||
@@ -1635,6 +1637,7 @@ int readArgs() {
|
|||||||
|
|
||||||
if(argis("-som")) {
|
if(argis("-som")) {
|
||||||
PHASE(3);
|
PHASE(3);
|
||||||
|
initialize_rv();
|
||||||
shift(); kohonen::loadsamples(args());
|
shift(); kohonen::loadsamples(args());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1690,6 +1693,10 @@ int readArgs() {
|
|||||||
shift_arg_formula(learning_factor);
|
shift_arg_formula(learning_factor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if(argis("-som-random-initial")) {
|
||||||
|
set_neuron_initial();
|
||||||
|
}
|
||||||
|
|
||||||
else if(argis("-som-analyze")) {
|
else if(argis("-som-analyze")) {
|
||||||
analyze();
|
analyze();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user