This is the main class of kissinference, it allows you to load and use Kiss neural neturoks.
More...
Inherits System.IDisposable.
|
delegate void | ResultDlg (float[] result, Network network) |
|
| Network (string path, bool verbose=false) |
| Constructs a new Network object by loading a network off disk.
|
|
AutoResetEvent | Run (Spectra spectra, ResultDlg callback) |
| This method runs an inference pass on the given spectra asynchronously.
|
|
AutoResetEvent | Run (float[] data, ResultDlg callback) |
| This method runs an inference pass on the given spectra asynchronously.
|
|
void | Dispose () |
|
|
virtual void | Dispose (bool disposing) |
|
|
int | InputSize [get] |
| This Property holds the number of input values the loaded network expects.
|
|
int | OutputSize [get] |
| This Property holds the number of output values the loaded network expects.
|
|
string | Purpose [get] |
| This Property holds a string describeing the purpose the network was trained on.
|
|
string | InputLabel [get] |
| This Property holds a string describeing the type of input the network expects.
|
|
bool | ComplexInput [get] |
| This Property is true if the network expects a complex valued input.
|
|
string[] | OutputLabels [get] |
| This Property is an array of OutputSize with strings nameing what every output corrisponds to.
|
|
bool[] | OutputMask [get, set] |
| This Property is an array of bools enableing or disableing a given output.
|
|
This is the main class of kissinference, it allows you to load and use Kiss neural neturoks.
◆ Network()
Kiss.Network.Network |
( |
string | path, |
|
|
bool | verbose = false ) |
|
inline |
Constructs a new Network object by loading a network off disk.
- Parameters
-
path | the path to the onnx network file to load |
verbose | if true is set here some extra debug information will be printed by the runtime |
- Exceptions
-
System.IO.FileLoadException | Thrown when the network file could not be loaded |
Kiss.EnviromentException | Thrown if the enviroment is unacceptable for the operation of this libaray |
References Kiss.Utils.CheckEnvThrow().
◆ Run() [1/2]
AutoResetEvent Kiss.Network.Run |
( |
float[] | data, |
|
|
ResultDlg | callback ) |
|
inline |
This method runs an inference pass on the given spectra asynchronously.
- Parameters
-
data | and array of floats containing the data inference on, must be of InputSize length |
callback | a delegate that will be called when inference completes, this callback will be called from a native thread in libkissiniferences thread pool |
- Exceptions
-
ArgumentException | Thrown when the input is of an incorrect size for the network |
InferenceException | Thrown when the inference engine encounteres an internal error |
- Returns
- The AutoResetEvent returned can be waited on to ensure that the inference is finished and the callback has been executed.
◆ Run() [2/2]
AutoResetEvent Kiss.Network.Run |
( |
Spectra | spectra, |
|
|
ResultDlg | callback ) |
|
inline |
This method runs an inference pass on the given spectra asynchronously.
- Parameters
-
spectra | the spectra to run inference on, must be of InputSize length |
callback | a delegate that will be called when inference completes, this callback will be called from a native thread in libkissiniferences thread pool |
- Exceptions
-
ArgumentException | Thrown when the input is of an incorrect size for the network |
InferenceException | Thrown when the inference engine encounteres an internal error |
- Returns
- The AutoResetEvent returned can be waited on to ensure that the inference is finished and the callback has been executed.
References Kiss.Spectra.Imaginary, and Kiss.Spectra.Real.
◆ InputSize
int Kiss.Network.InputSize |
|
get |
This Property holds the number of input values the loaded network expects.
For networks with a convolutional input this may be -1 designateing "Any"
◆ OutputMask
bool [] Kiss.Network.OutputMask |
|
getset |
This Property is an array of bools enableing or disableing a given output.
This Property must only be set while no inference requests are pending. Disabled outputs will set to zero, exact effect on non-disabled outputs is network depenant. For classifier networks the likelyhoods will reflect the reduction in problem space.