Search code examples
javadatabaseserializationneural-networkencog

serialize java encog network to database


I'm using the java encog library and wanted to know how to serialize the sample XOR network to a mysql database. I'm rather new to working with databases in java. I'm guessing it has to do with the EncogDirectoryPersist class but was wondering how to modify that to return something that can be sent to a database.

thanks


Solution

  • It looks like you could just use normal java serialization to serialize to a byte array (look at using the commons-lang3 library to do this in one line with org.apache.commons.lang3.SerializationUtils.serialize(Serializable)), then store this in the database as a binary column.