UNPKG

ppljs-ppl-core

Version:

ppljs network inference framework core module

25 lines (19 loc) 1.45 kB
@author xusiyu@sensetime.com PPL.js json format follows thd definition of OpNode in interface.ts file: the total model is representer by OpNode,and OpNode is composed by some attributes as follows: /*****************************************************************************************/ 1.props:OpProps OpPros defines the Op's type and name.Common op types such as "Conv","Relu"...Now we only support the caffe op, so you can search the op's specific definitions on the caffe official website.The name of op is a unique value, we can use this value to find and operate a specific op 2.attrs:OpAttrs 3.inputs:OpEdge[] The model must have at least one inputs OpEdge whose name contains "input".for example,if model have 4 inputs, you should name corresponding op's inputs's name "input0"/"input1"/"input2"/"input3" 4.outputs:OpEdge[] The model must have at least one outputs OpEdge whose name contains "output".for example,if model have 4 outputs,you should name corresponding op's outputs's name "output0"/"output1"/"output2"/"output3" 5.hostDataOffset:number; 6.data:OpData The data structure is composed of key-value pairs. The key is the name of the parameter with op, and the value is the tensorInfo interface.The tensorInfo is composed of {name,shape,precision,hostData,deviceData},we will Initialize data such as weights/bias in hostData,If the backend is gpu,we will copy the hostData to deviceData in the end.