-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Anomaly removal, cleanup #347
Comments
I haven't looked into this, but i was thinking anyways. Maybe the TM could have a conveience method to compute the anomaly? |
yes, I'm thinking in this direction too.
|
This will also depend on decision in #95 , if TP/Cells are removed, Anomaly would be only used by TM, so it'd be trivial to move it there (and rm Anomaly class) |
Ok, I looked into this some more. I think the best option would be to fully merge the anomaly class into the TM, and remove the anomaly class. There is too much logic that needs to be done to prepare the data for the anomaly class, for example from TM unit tests: // Get the predictions from the previous cycle.
tm.activateDendrites(true, ... );
auto predictedColumns = tm.getPredictiveCells();
// Convert from cells to mini-columns
for(UInt i = 0; i < predictedColumns.size(); i++) {
predictedColumns[i] /= tm.getCellsPerColumn();
if(i > 0 && predictedColumns[i] == predictedColumns[i-1])
predictedColumns.erase( predictedColumns.begin() + i-- );
}
// Calculate TM output
const auto &sparse = x.getSparse();
tm.compute(sparse.size(), sparse.data(), true);
// Calculate Anomaly of current input based on prior predictions.
anom = algorithms::anomaly::computeRawAnomalyScore(
x.getSparse(), predictedColumns); Notice that in order to use the Anomaly class the user needs to use the split compute - activateDendrites & activateCells. |
Thank you. Nicely done by the way. |
can you post a link please, I couldn't find it at the forums. |
Link to forum survey about backtracking TM: https://discourse.numenta.org/t/biological-constraints/5687 |
I think you can get started with, if you're interested that is. You don't need to wait until the survey I posted is complete. Regardless of what happens to the backtracking TM, we should still incorporate the Anomaly into the regular TM. For now, since we're not yet deleting any files, the TM can simply delegate the work to the Anomaly functions. The method Also, the ColumnPooler does not need it's own implementation of Anomaly. The ColumnPooler contains a TemporalMemory instance and will call the TM's anomaly method. |
Added TODO that VectorHelpers::columnsFromCells should be moved to TM, #331 (comment) |
I'll start with this issue, one more thing we need to make clear:
|
The raw anomaly score is the fraction of active mini-columns which were not predicted. Q1: only feed forward activity. By the time the feed forward activity reaches the TM, it will be a list of active mini-columns. |
I have revisited the Anomaly class and I'd like to propose a removal, cleanup of said class, keeping only the
computeRawAnomalyScore()
method, and possible a (new)Anomaly::compute(SDR)
which has only 1 parameter, and handles the bookkeeping of previous pattern for anomaly.This will make the code simple, help some confusion in documantation of that class, ...
TM::anomalyScore()
VectorHelpers::columnsFromCells()
to TM, as the method is only correct for TM's mini-columns, see Connections better use typedefed types Segment, Synapse, ... #331 (comment)const SDR TM::active/predicted/both
The text was updated successfully, but these errors were encountered: