exptest

command
v2.0.0-dev0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

README

This example tests for numerical differences between the GPU and CPU, running the same code on the same numbers on both sides and comparing the results.

In axon, we have divergences from GABA and NMDA conductances, and these appear to be inevitable, given the outcome of these tests.

Here's a summary of the results:

    // Out[idx.x] = FastExp(In[idx.x]); // 0 diffs
	float vbio = In[idx.x];
	float eval = 0.1 * ((vbio + 90.0) + 10.0);
	// Out[idx.x] = (vbio + 90.0) / (1.0 + FastExp(eval)); // lots of diffs
	// Out[idx.x] = (vbio + 90.0) / (1.0 + exp(eval)); // worse
	// Out[idx.x] = eval; // 0 diff
	// Out[idx.x] = 1.0 / eval; // a few 2.98e-8 diffs already!
	Out[idx.x] = 1.0 / FastExp(eval); // lots more diffs, e-08, -09

Interestingly, FastExp itself does not have any diffs but even simple 1.0 / division introduces issues.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL