A graph is a collection of buffers and nodes that together form a neural network. The graph is created from a json definition file. After creation, the contents of the graph can be loaded from or saved to disk.
More...
|
virtual const char * | GetName () const =0 |
| Returns the name of the graph. More...
|
|
virtual ObjectPtr< IContext > | GetContext () const =0 |
| Returns the context associated with the graph More...
|
|
virtual ObjectPtr< IGraph > | DeepCopy () const =0 |
| Copies the internal structure of the graph into a new graph More...
|
|
virtual ObjectPtr< IGraph > | Instance ()=0 |
| Creates a copy of this graph with all internal weights referenced to this graph. More...
|
|
virtual void | BindComponentInputs (const ComponentInputBinding *bindings, int bindingCount)=0 |
| Binds the component inputs in the graph to the specified set of nodes. Any component inputs not included will be bound to buffer inputs. More...
|
|
virtual void | CopyWeightsFrom (IGraph *graph, float percent=1.0f)=0 |
| Copies the neuron layer weights from the specified graph into this graph. The specified graph must have the same exact structure as this graph. More...
|
|
virtual void | SetRandomWeights ()=0 |
| Initialize the weights trainable layers to random values. More...
|
|
virtual void | AddNode (IGraphNode *node)=0 |
| Adds a node to the graph. This will be considered an output node until a node connecting to this one is added to the graph. More...
|
|
template<typename T > |
ObjectPtr< T > | GetNode (const char *name) const |
| Returns the specified node as the specified type. Null is returned if the node is not found or is of a different type. More...
|
|
virtual ObjectPtr< IGraphNode > | GetOutputNode (int index) const =0 |
| Returns an output node of the graph as a GraphNode. The nodes are ordered in the appearance in the graph definition or the order they were added manually. More...
|
|
virtual float | GetWeightStandardDeviation () const =0 |
| Returns the average standard deviation of all trainable weights in the graph. More...
|
|
virtual int | GetSequenceLength () const =0 |
| Returns the desired sequence length for this graph. This is after how many steps the graph should be reset. Only applicable to graphs that need to be stepped (such as LSTMs). More...
|
|
virtual void | SetSequenceLength (int stepCount)=0 |
| Sets the desired sequence length for this graph. This is after how many steps the graph should be reset. Only applicable to graphs that need to be stepped (such as LSTMs). More...
|
|
virtual void | ResetNeuronLayers ()=0 |
| Calls Reset() on all trainable layers in the graph. This is only necessary for LSTM neuron layers. More...
|
|
virtual void | StepNeuronLayers (bool autoReset=true)=0 |
| Calls Step() on all trainable layers in the graph. This is only necessary for LSTM neuron layers. More...
|
|
virtual const char * | GetResourceName () const =0 |
| Returns the name of this resource passed to the constructor. More...
|
|
virtual SerializationResult | GetLastLoadResult () const =0 |
| Returns the result of the last call to Load(). Useful for checking loaded data state after creation. More...
|
|
virtual SerializationResult | Load (const char *appendName=nullptr)=0 |
| Load this object from disk. More...
|
|
virtual SerializationResult | Save (const char *appendName=nullptr)=0 |
| Save this object to disk. More...
|
|
virtual ObjectId | GetId () const =0 |
| Returns the ID of this object. More...
|
|
virtual void | AddRef () const =0 |
| Increments the internal reference count on this object. It is not common to use this method directly. More...
|
|
virtual void | Release () const =0 |
| Decrements the internal reference count on this object. It is not common to use this method directly. More...
|
|
virtual int | GetRefCount () const =0 |
| Returns the number of references to this object. More...
|
|
virtual void * | QueryInterface (ObjectClassId id)=0 |
| Queries the object for an interface and returns a pointer to that interface if found. More...
|
|
void | operator= (IObject const &x)=delete |
|
virtual SerializationResult | Serialize (IMemoryBuffer *buffer)=0 |
| Write the contents of this object to a buffer. More...
|
|
virtual SerializationResult | Deserialize (IMemoryBuffer *buffer)=0 |
| Fill this object with contents from a buffer. More...
|
|
A graph is a collection of buffers and nodes that together form a neural network. The graph is created from a json definition file. After creation, the contents of the graph can be loaded from or saved to disk.
When loading from a resource, two assets will try to load. One will be the resourceName + "Definition", which should be a json text asset. The other will be resourceName + "Data", which will be the graph data. The definition is required, but the data can be missing on creation.
virtual void SmartEngine::IGraph::BindComponentInputs |
( |
const ComponentInputBinding * |
bindings, |
|
|
int |
bindingCount |
|
) |
| |
|
pure virtual |
Binds the component inputs in the graph to the specified set of nodes. Any component inputs not included will be bound to buffer inputs.
This should only be called once before first evaluation. It is not necessary to call this if the graph is used as a graph component or added as a standard graph model to a graph manager.
Called automatically by IGraphComponent upon creation.
Any created buffer inputs will have the name "[Comp Input Name]Buffer" and will be added to the graph. (Ex: "MyCompInput" would have a buffer "MyCompInputBuffer" that can be queried through normal means)
- Parameters
-