NaN Magic or Why Me?! [message #56761] |
Tue, 13 November 2007 09:42  |
Mort Canty
Messages: 134 Registered: March 2003
|
Senior Member |
|
|
Hi. Here's a trick with IDL: I'm running a neural network program (IDL
6.3, Windows XP) which is printing out a cost function as it goes:
1.41914e+006 332780. 328493.
363745. 327434. 333099.
334286. 320390. 371921.
349013. 304647. 323247.
314879. 312924. 386168.
362931. 346616. 306625.
340137. 309213. 302789.
302587. 313369. 310620.
301379. 307119. 302866.
307930. 295240. 304881.
301841. 317709. 292358.
321169. 297112. 391706.
297928. 305506. 299264.
315475. 288123. 292904.
308228. 294505. 288769.
305784. 299221. 359080.
295104. 297367. 302781.
290047. 277969. 285225.
279158. 283448. 306711.
282240. 283696. 283543.
294153. -NaN 280851.
281700. 303358.
Did you see the NaN? Now watch: I restart the program under identical
conditions:
1.41914e+006 332780. 328493.
363745. 327434. 333099.
334286. 320390. 371921.
349013. 304647. 323247.
314879. 312924. 386168.
362931. 346616. 306625.
340137. 309213. 302789.
302587. 313369. 310620.
301379. 307119. 302866.
307930. 295240. 304881.
301841. 317709. 292358.
321169. 297112. 391706.
297928. 305506. NaN
315475. 288123. 292904.
308228. 294505. 288769
...
Cool huh? Sequence is identical but the NaN has moved (and changed sign
to boot). That's not all. Now I logout and logon under a different user
account. Same program, same IDL, same conditions:
1.41914e+006 332780. 328493.
363745. 327434. 333099.
334286. 320390. 371921.
349013. 304647. 323247.
314879. 312924. 386168.
362931. 346616. 306625.
340137. 309213. 302789.
302587. 313369. 310620.
301379. 307119. 302866.
307930. 295240. 304881.
301841. 317709. 292358.
321169. 297112. 391706.
297928. 305506. 299264.
315475. 288123. 292904.
308228. 294505. 288769.
305784. 299221. 359080.
295104. 297367. 302781.
290047. 277969. 285225.
279158. 283448. 306711.
282240. 283696. 283543.
294153. 446049. 280851.
281700. 303358. 355329.
288240. 297747. 315557.
287779. 314566. 272712.
290404. 278610. 281469.
297105.
Where'd it go?. Now the program runs forever without any NaNs. I'd like
to post the code so you, too, can amaze your friends, but unfortunately
the trick only works on my bloody computer.
Seriously, can someone, anyone, tell me might be going on?
Cheers
Mort
PS It's not a memory error. I replaced the DIMMS completely.
|
|
|