views:

66

answers:

1

I'm using ruby's ai4r gem, building a neural network. Version 1.1 of the gem allowed me to simply do a Marshal.dump(network) to a file, and I could load the network back up whenever I wanted.

With version 1.9 a couple years later, I'm no longer able to do this. It generates this error when I try:

no marshal_dump is defined for class Proc

I know the reason for the error - Marshal can't handle procs in an object. Fair enough.

So is there something built in to ai4r? I've been searching with no luck. I can't imagine any practical use for a neural network you have to rebuild from scratch every time you want to use it.

A: 

Hi,

I just fixed that problem. Version 1.10 should work OK.

However, if you customize the propagation function with a lambda function, you will have to restore it manually after loading the instance. This is because lambda functions cannot be serialized, so the implementation reset it to the default function. Sorry for not solving it sooner, but I have been having some crazy months at work.

Cheers,

Sergio Fierens.

Sergio Fierens