Comments (3)
Please see these classes in the SharpNeat.Neat.Genome.IO namespace:
NeatGenomeSaver
NeatGenomeLoader
NeatGenomeLoaderFactory
You need to get an instance of NeatGenomeLoader, and the easiest way to do that is by calling static helper method NeatGenomeLoaderFactory.CreateLoaderDouble(); that in turn requires a MetaNeatGenome object to be supplied, with these properties set accordingly:
/// <summary>
/// Input node count.
/// </summary>
public int InputNodeCount { get; }
/// <summary>
/// Output node count.
/// </summary>
public int OutputNodeCount { get; }
/// <summary>
/// Indicates if the genomes that are evolved are acyclic, i.e. they should have no recurrent/cyclic connection paths.
/// </summary>
public bool IsAcyclic { get; }
/// <summary>
/// The neuron activation function to use in evolved networks. NEAT uses the same activation
/// function at each node.
/// </summary>
public IActivationFunction<T> ActivationFn { get; }
Some of that info is redundant because it is saved in the genome data file. This is so that we can compare a loaded genome with the expected parameters for a given experiment we are loading it for (e.g. number of inputs and outputs).
This could all be a lot clearer I think, especially for the use case of loading an evolved network for direct use where you don't care that it came from a NeatGenome, but hopefully the above info allows you to do what you want today. The genome data format is very simple actually, so it should be relatively straightforward to write some code to load a genom data file directly into one of the NeuralNet types.
from sharpneat.
These classes looks very nice to save progress of the evolution - thank you for that. My point was exactly pointing out this:
The genome data format is very simple actually, so it should be relatively straightforward to write some code to load a genom data file directly into one of the NeuralNet types.
I think that this code is already written - CreateGenomeDecoder from experiemnt. You easily can create experiment - since you already need it for evolution phase - why not use is again in the loading phase. Use GenomeDecoder either created from INeatExperiment (simmilar properties as MetaNeatGenome) - Is acyclic etc.
public class MetaNeatGenome<T> where T : struct
{
#region Auto Properties
/// <summary>
/// Input node count.
/// </summary>
public int InputNodeCount { get; }
/// <summary>
/// Output node count.
/// </summary>
public int OutputNodeCount { get; }
/// <summary>
/// Indicates if the genomes that are evolved are acyclic, i.e. they should have no recurrent/cyclic connection paths.
/// </summary>
public bool IsAcyclic { get; }
/// <summary>
/// The neuron activation function to use in evolved networks. NEAT uses the same activation
/// function at each node.
/// </summary>
public IActivationFunction<T> ActivationFn { get; }
From INeatExperiment
bool IsAcyclic { get; set; }
int CyclesPerActivation { get; set; }
string ActivationFnName { get; set; }
you even can create MetaNeatGenome from INeatExperiment with:
NeatUtils.CreateMetaNeatGenome(neatExperiment)
I think that either make CreateGenomeDecoder or maybe extend your IO namespace with directly loading into NeuralNet type would be much more clear.
By the way thank you very much for creating this framework.
from sharpneat.
Resolved.
Please see #55
from sharpneat.
Related Issues (20)
- Any tutorial? HOT 2
- Binary N-multiplexer task revamp HOT 2
- Make use of ArrayPool<T> to reduce memory allocs for neural net arrays. HOT 2
- Add Task visualizations
- SharpNeat.Windows.App: Add missing generic functionality HOT 3
- Refactor IDistanceMetric.CalculateCentroid() and k-means speciation generally, to use LightweightList and Span.
- Revise use of Math.FusedMultiplyAdd() HOT 1
- Getting blackbox for evaluation from persisted genome HOT 2
- How can I set up genome vs genome competitive evaluation/evolutionary algorithm? HOT 3
- NeatGenomeSaver.WriteConnections is culture-dependent HOT 1
- Review genome and network IO situation. HOT 1
- Add an .editorconfig file to root of project. HOT 2
- Performance tune activation functions HOT 1
- Performance tune NeuralNetCyclic (scalar and vectorized) HOT 1
- BackgroundThreadMethod() failed with exception HOT 6
- README.md improvements HOT 1
- Documentation, usages and structure of building a neural network?
- Make use of Dependency Injection
- Create Nuget Packages
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sharpneat.