Copyright | (c) 2016 Tao He |
---|---|
License | MIT |
Maintainer | sighingnow@gmail.com |
Safe Haskell | Safe |
Language | Haskell2010 |
Predict interfaces in core module of MXNet.
- data PredictorHandle
- data NDListHandle
- mxGetLastError :: IO String
- mxPredCreate :: String -> Ptr () -> Int -> Int -> Int -> MXUInt -> [String] -> [MXUInt] -> [MXUInt] -> IO (Int, PredictorHandle)
- mxPredCreatePartialOut :: String -> Ptr () -> Int -> Int -> Int -> MXUInt -> [String] -> [MXUInt] -> [MXUInt] -> MXUInt -> IO (Int, String, PredictorHandle)
- mxPredGetOutputShape :: PredictorHandle -> MXUInt -> IO (Int, [MXUInt], MXUInt)
- mxPredSetInput :: PredictorHandle -> String -> [MXFloat] -> MXUInt -> IO Int
- mxPredForward :: PredictorHandle -> IO Int
- mxPredPartialForward :: PredictorHandle -> Int -> IO (Int, Int)
- mxPredGetOutput :: PredictorHandle -> MXUInt -> Ptr MXFloat -> MXUInt -> IO Int
- mxPredFree :: PredictorHandle -> IO Int
- mxNDListCreate :: Ptr CChar -> Int -> IO (Int, NDListHandle, MXUInt)
- mxNDListGet :: NDListHandle -> MXUInt -> IO (Int, String, Ptr MXFloat, [MXUInt], MXUInt)
- mxNDListFree :: NDListHandle -> IO Int
Data types
Re-exports functions.
mxGetLastError :: IO String Source #
Handle size_t type.
Get the string message of last error.
:: String | The JSON string of the symbol. |
-> Ptr () | The in-memory raw bytes of parameter ndarray file. |
-> Int | The size of parameter ndarray file. |
-> Int | The device type, 1: cpu, 2:gpu. |
-> Int | The device id of the predictor. |
-> MXUInt | Number of input nodes to the net. |
-> [String] | The name of input argument. |
-> [MXUInt] | |
-> [MXUInt] | |
-> IO (Int, PredictorHandle) | The created predictor handle. |
Create a predictor.
mxPredCreatePartialOut Source #
:: String | |
-> Ptr () | |
-> Int | |
-> Int | |
-> Int | |
-> MXUInt | |
-> [String] | The names of input arguments. |
-> [MXUInt] | |
-> [MXUInt] | |
-> MXUInt | Number of output nodes to the net. |
-> IO (Int, String, PredictorHandle) | The name of output argument and created predictor handle. |
Create a predictor wich customized outputs.
:: PredictorHandle | The predictor handle. |
-> MXUInt | The index of output node, set to 0 if there is only one output. |
-> IO (Int, [MXUInt], MXUInt) | Output dimension and the shape data. |
Get the shape of output node.
:: PredictorHandle | |
-> String | The name of input node to set. |
-> [MXFloat] | The pointer to the data to be set. |
-> MXUInt | The size of data array, used for safety check. |
-> IO Int |
Set the input data of predictor.
mxPredForward :: PredictorHandle -> IO Int Source #
Run a forward pass to get the output.
:: PredictorHandle | |
-> Int | The current step to run forward on. |
-> IO (Int, Int) | The number of steps left. |
Run a interactive forward pass to get the output.
:: PredictorHandle | |
-> MXUInt | The index of output node, set to 0 if there is only one output. |
-> Ptr MXFloat | User allocated data to hold the output. |
-> MXUInt | The size of data array, used for safe checking. |
-> IO Int |
Get the output value of prediction.
mxPredFree :: PredictorHandle -> IO Int Source #
Free a predictor handle.
:: Ptr CChar | The byte contents of nd file to be loaded. |
-> Int | The size of the nd file to be loaded. |
-> IO (Int, NDListHandle, MXUInt) | The out put NDListHandle and length of the list. |
Create a NDArray List by loading from ndarray file.
:: NDListHandle | |
-> MXUInt | The index in the list. |
-> IO (Int, String, Ptr MXFloat, [MXUInt], MXUInt) | The name of output, the data region of the item, the shape of the item and shape's dimension. |
Get an element from list.
mxNDListFree :: NDListHandle -> IO Int Source #
Free a predictor handle.