-
Notifications
You must be signed in to change notification settings - Fork 32
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
Floating point error if optimized code used #689
Comments
Presumably the optimized code is the weave version of the code? Maybe you could try to switch to the cythonized version in that case. You can see those being added here: topographica/topo/submodel/scal.py Line 217 in f945a8b
|
AFAIK I am using the Cython code:
|
Correction. This was in spite of building with Cython as you saw in my previous message. This is my first time encountering weave. When I uninstall weave I get back the "Unable to import Weave" message again. Now that you showed how to activate the cython code in the model I'll give it a try. |
Ran with the Cython code. Got the same error: /Users/fred/Development/topographica/external/featuremapper/featuremapper/collector.pyc in call(self, attrtree, times, strict) /Users/fred/Development/topographica/external/holoviews/holoviews/ipython/widgets.pyc in call(self, value) /Users/fred/Development/topographica/topo/base/simulation.pyc in run(self, duration, until) /Users/fred/Development/topographica/topo/base/simulation.pyc in call(self, sim) /Users/fred/Development/topographica/topo/sheet/init.pyc in input_event(self, conn, data) /Users/fred/Development/topographica/topo/base/projection.pyc in input_event(self, conn, data) /Users/fred/Development/topographica/topo/base/projection.pyc in present_input(self, input_activity, conn) /Users/fred/Development/topographica/topo/base/cf.pyc in activate(self, input_activity) FloatingPointError: invalid value encountered in multiply` |
Run GCAL_Tutorial.ipynb after building the optimized code.
During the stage of "Rebuilding snapshot 'lissom_oo_or_10000.typ' " generally get:
FloatingPointError Traceback (most recent call last)
in ()
9 model_dir = param.resolve_path('examples' if model=='GCAL' else 'models', path_to_file=False)
10 runscript(os.path.join(model_dir, basename + ".ty")) # Load the model
---> 11 topo.sim.views = c(times=times)
12 save_snapshot(snapshot_name)
13
/Users/fred/Development/topographica/external/featuremapper/featuremapper/collector.pyc in call(self, attrtree, times, strict)
541 try:
542 for i, t in enumerate(np.diff(times)):
--> 543 interval_hook(float(t))
544
545 # An empty attrtree buffer stops analysis repeatedly
/Users/fred/Development/topographica/external/holoviews/holoviews/ipython/widgets.pyc in call(self, value)
203 remaining = value - completed
204 if remaining != 0:
--> 205 self.run_hook(remaining)
206 super(RunProgress, self).call(100)
207
/Users/fred/Development/topographica/topo/base/simulation.pyc in run(self, duration, until)
1345 event = self.events.pop(0)
1346 self.debug("Delivering %s",event)
-> 1347 event(self)
1348 did_event=True
1349
/Users/fred/Development/topographica/topo/base/simulation.pyc in call(self, sim)
446
447 def call(self,sim):
--> 448 self.conn.dest.input_event(self.conn,self.data)
449
450 def repr(self):
/Users/fred/Development/topographica/topo/sheet/init.pyc in input_event(self, conn, data)
314 proj.activity *= 0.0
315 self.mask.reset()
--> 316 super(SettlingCFSheet,self).input_event(conn,data)
317
318
/Users/fred/Development/topographica/topo/base/projection.pyc in input_event(self, conn, data)
467 """
468 self.verbose("Received input from %s on dest_port %s via connection %s.", conn.src.name,conn.dest_port,conn.name)
--> 469 self.present_input(data,conn)
470 self.new_input = True
471
/Users/fred/Development/topographica/topo/base/projection.pyc in present_input(self, input_activity, conn)
596 is called.
597 """
--> 598 conn.activate(input_activity)
599
600
/Users/fred/Development/topographica/topo/base/cf.pyc in activate(self, input_activity)
811 iaf(input_activity)
812 self.input_buffer = input_activity
--> 813 self.activity *=0.0
814 self.response_fn(CFIter(self), input_activity, self.activity, self.strength)
815 for of in self.output_fns:
FloatingPointError: invalid value encountered in multiply
Note that this does not occur if the non optimized code is used (but the process takes forever).
The text was updated successfully, but these errors were encountered: