Thread overview
Flaoting point operations : unexpected results
Jun 10
seany
Jun 10
Dennis
Jun 10
seany
Jun 11
frame
June 10

I have (as mentioned before) an AI project in D.
It is doing several million Floating Point operations.

However, i sometimes see, that the results are radically different.

The same input, fed to the same system .

I do not have and random values. There are some foreach loops.

By radically different, i mean, that the computation whether some points are within some bound or not goes completely out of control. Sometimes they produce correct result, sometimes all results are zero.

Is there a "reproducability" problem?

Thank you.

June 10

On Thursday, 10 June 2021 at 19:37:36 UTC, seany wrote:

>

However, i sometimes see, that the results are radically different.

Are you using uninitialized memory or multi-threading?

June 10

On Thursday, 10 June 2021 at 19:51:51 UTC, Dennis wrote:

>

On Thursday, 10 June 2021 at 19:37:36 UTC, seany wrote:

>

However, i sometimes see, that the results are radically different.

Are you using uninitialized memory or multi-threading?

I am using things like :

double [][] myArr = new double [][] (0,0);

and

double [][] tempArr;

and

class myclass {

 int a ;
 this(){}
 ~this(){}
}

followed by :

myclass mc = new myclass;

I dont think these are "uninitialized"?

June 10

Normally computers are deterministic and same input produces same output. There is however theory on neural network stability and it can be tuned.

June 11

On Thursday, 10 June 2021 at 20:18:03 UTC, seany wrote:

>

On Thursday, 10 June 2021 at 19:51:51 UTC, Dennis wrote:

>

On Thursday, 10 June 2021 at 19:37:36 UTC, seany wrote:

>

However, i sometimes see, that the results are radically different.

Are you using uninitialized memory or multi-threading?

I am using things like :

double [][] myArr = new double [][] (0,0);

>

I dont think these are "uninitialized"?

Just to clarify, this statement does not initialize double values to 0. It just creates the array with lengths of 0. If you disable range checking as in release mode, you wouldn't see any error here.