mirror of
https://github.com/BlackLight/Snort_AIPreproc.git
synced 2024-11-23 20:25:12 +01:00
Improving neural correlation algorithm
This commit is contained in:
parent
50f287fbb5
commit
fcb2f25476
1 changed files with 5 additions and 1 deletions
6
neural.c
6
neural.c
|
@ -289,6 +289,8 @@ double
|
|||
AI_alert_neural_som_correlation ( const AI_snort_alert *a, const AI_snort_alert *b )
|
||||
{
|
||||
AI_som_alert_tuple t1, t2;
|
||||
double distance = 0.0,
|
||||
max_distance = 0.0;
|
||||
|
||||
t1.gid = a->gid;
|
||||
t1.sid = a->sid;
|
||||
|
@ -310,7 +312,9 @@ AI_alert_neural_som_correlation ( const AI_snort_alert *a, const AI_snort_alert
|
|||
t2.timestamp = b->timestamp;
|
||||
t2.desc = b->desc;
|
||||
|
||||
return 1.0 / ( 1.0 + __AI_som_alert_distance ( t1, t2 ));
|
||||
distance = __AI_som_alert_distance ( t1, t2 );
|
||||
max_distance = sqrt ((double) ( 2 * (config->outputNeuronsPerSide-1) * (config->outputNeuronsPerSide-1) ));
|
||||
return (( distance == max_distance ) ? 0.0 : ( 1.0 / ( 1.0 + distance )));
|
||||
} /* ----- end of function AI_alert_neural_som_correlation ----- */
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue