Skip to content

Commit 2916daf

Browse files
benizsileht
authored andcommitted
fix(doc): update to neural network templates and output connector
parameters
1 parent 67b1d99 commit 2916daf

File tree

1 file changed

+61
-6
lines changed

1 file changed

+61
-6
lines changed

docs/api.md

+61-6
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,9 @@ template | string | yes | empty | Output temp
10431043
network | object | yes | empty | Output network parameters for pushing the output into another listening software
10441044
measure | array | yes | empty | Output measures requested, from `acc`: accuracy, `acc-k`: top-k accuracy, replace k with number (e.g. `acc-5`), `f1`: f1, precision and recall, `mcll`: multi-class log loss, `auc`: area under the curve, `cmdiag`: diagonal of confusion matrix (requires `f1`), `cmfull`: full confusion matrix (requires `f1`), `mcc`: Matthews correlation coefficient
10451045
confidence_threshold | double | yes | 0.0 | only returns classifications or detections with probability strictly above threshold
1046-
bbox | bool | yes | false | returns bounding boxes around object when using an object detection model, such that (xmin,ymax) yields the top left corner and (xmax,ymin) the lower right corner of a box.
1046+
bbox | bool | yes | false | returns bounding boxes around object when using an object detection model, such that (xmin,ymax) yields the top left corner and (xmax,ymin) the lower right corner of a
1047+
box.
1048+
regression | bool | yes | false | whether the output of a model is a regression target (i.e. vector of one or more floats)
10471049
rois | string | yes | empty | set the ROI layer from which to extract the features from bounding boxes. Both the boxes and features ar returned when using an object detection model with ROI pooling layer
10481050
index | bool | yes | false | whether to index the output from prediction, for similarity search
10491051
build_index | bool | yes | false | whether to build similarity index after prediction, no more indexing can be done afterward
@@ -1212,9 +1214,9 @@ No parameters
12121214
12131215
## Output connectors
12141216
1215-
The output connector is at this stage very simple, and dedicated to supervised machine learning output.
1217+
The output connector controls the output formats for supervised and unsupervised models.
12161218
1217-
Its two main features are the control of the number of predictions per URI, and the output templating, which allows for custom output and seamless integration in external applications.
1219+
Its two main features are the control of the number of predictions per URI, and the output templating, which allows for custom output and seamless integration in external applications. Other options modulates the output format.
12181220
12191221
Parameter | Type | Optional | Default | Description
12201222
--------- | ---- | -------- | ------- | -----------
@@ -1224,6 +1226,22 @@ template | string | yes | empty | Output template in Mustache
12241226
confidence_threshold | double | yes | 0.0 | only returns classifications or detections with probability strictly above threshold
12251227
bbox | bool | yes | false | returns bounding boxes around object when using an object detection model
12261228
regression | bool | yes | false | whether the output of a model is a regression target (i.e. vector of one or more floats)
1229+
rois | string | yes | empty | set the ROI layer from which to extract the features from bounding boxes. Both the boxes and features ar returned when using an object detection model with ROI pooling layer
1230+
index | bool | yes | false | whether to index the output from prediction, for similarity search
1231+
build_index | bool | yes | false | whether to build similarity index after prediction, no more indexing can be done afterward
1232+
search | bool | yes | false | whether to use the predicted output for similarity search and return pre-indexed nearest neighbors
1233+
multibox_rois | bool | yes | false | aggregates bounding boxes ROIs features (requires `rois`) for image similarity search
1234+
index_type | string | yes | Flat | for faiss index indexing backend only : a FAISS index factory string , see https://github.com/facebookresearch/faiss/wiki/Guidelines-to-choose-an-index
1235+
index_gpu | bool | yes | false | for faiss indexing backend only : if available, build idnex on GPU
1236+
index_gpuid | int | yes | all | for faiss indexing backend only : which gpu to use if index_gpu is true
1237+
train_samples | int | yes | 100000 | for faiss indexing backend only : number of samples to use for training index. Larger values lead to better indexes (more evenly distributed) but cause much larger index training time. Many indexes need a minimal value depending on the number of clusters built, see https://github.com/facebookresearch/faiss/wiki/Guidelines-to-choose-an-index.
1238+
ondisk | bool | yes | true | for faiss indexing backend only : try to directly build indexes on mmaped files (IVF index_types only can do so)
1239+
nprobe | int | yes | max(ninvertedlist/50,2) | for faiss indexing backend only : number of cluster searched for closest images: for highly compressing indexes, setting nprobe to larger values may allow better precision
1240+
ctc | bool | yes | false | whether the output is a sequence (using CTC encoding)
1241+
confidences | array | yes | empty | Segmentation only: output confidence maps for "best" class, "all" classes, or classes being specified by number, e.g. "1","3".
1242+
logits_blob | string | yes | "" | in classification services, this add raw logits to output. Usefull for calibration purposes
1243+
logits | bool | yes | False | in detection services, this add logits to output. Usefull for calibration purposes.
1244+
12271245
12281246
The variables that are usable in the output template format are those from the standard JSON output. See the [output template](#output-templates) dedicated section for more details and examples.
12291247
@@ -1299,18 +1317,55 @@ All models below are used by passing their id to the `mllib/template` parameter
12991317
13001318
Model ID | Type | Input | Description
13011319
-------- | ---- | ----- | -----------
1302-
lregression | linear | CSV | logistic regression
1303-
mlp | neural net | CSV | multilayer perceptron, fully configurable from API, see parameters below
1320+
lregression | linear | CSV / Txt | logistic regression
1321+
mlp | neural net | CSV / Txt | multilayer perceptron, fully configurable from API, see parameters below
1322+
recurrent | recurrent neural net | CSV / CSVTS | LSTM-based networks, fully configurable from API
13041323
convnet | convolutional neural net | Images | convolutional neural net, with layers configurable from API, see parameters below
13051324
alexnet | deep neural net | Images 227x227 | 'AlexNet', convolutional deep neural net, good accuracy, fast
13061325
cifar | deep neural net | Images 32x32 | Convolutional deep neural net, very good for small images
13071326
nin | deep neural net | Images 224x224 | 'Network in Network' convolutional deep neural net, good accuracy, very fast
13081327
googlenet | deep neural net | Images 224x224 | 'GoogleNet', convolutional deep neural net, good accuracy
1328+
resnet_10
13091329
resnet_18 | deep neural net | Image 224x224 | 'ResNet', 18-layers deep residual convolutional neural net, top accuracy
13101330
resnet_32 | deep neural net | Image 224x224 | 'ResNet', 32-layers deep residual convolutional neural net, top accuracy
13111331
resnet_50 | deep neural net | Image 224x224 | 'ResNet', 50-layers deep residual convolutional neural net, top accuracy
13121332
resnet_101 | deep neural net | Image 224x224 | 'ResNet', 101-layers deep residual convolutional neural net, top accuracy
13131333
resnet_152 | deep neural net | Image 224x224 | 'ResNet', 152-layers deep residual convolutional neural net, top accuracy
1334+
crnn | deep neural net | Images | Convolutional network plus CTC head for OCR
1335+
crnn_resnet_18 | deep neural net | Images | Convolutional network plus CTC head for OCR with ResNet-18 base
1336+
crnn_resnet_50 | deep neural net | Images | Convolutional network plus CTC head for OCR with ResNet-50 base
1337+
crnn_resnext_50 | deep neural net | Images | Convolutional network plus CTC head for OCR with ResNext-50 base
1338+
enet | deep neural net | Images | Convolutional network for segmentation
1339+
mobilenet_v2 | deep neural net | Images | Lightweight network for image classification
1340+
mobilenet_v2_ssd | deep neural net | Images | Lightweight network for object detection
1341+
pspnet_50 | deep neural net | Images | Convolutional network for segmentation with ResNet-50 base
1342+
pspnet_101 | deep neural net | Images | Convolutional network for segmentation with ResNet-101 base
1343+
pspnet_vgg16 | deep neural net | Images | Convolutional network for segmentation with VGG-16 base
1344+
refinedet_512 | deep neural net | Images | Convolutional network for object detection with VGG-16 base
1345+
refinedet_vovnet27slim_512 | deep neural net | Images | Convolutional network for object detection with VovNet-27-slim base
1346+
refinedet_vovnet39_512 | deep neural net | Images | Convolutional network for object detection with VovNet-39 base
1347+
resnet_10_ssd | deep neural net | Images | Convolutional network for object detection with ResNet-10 base
1348+
resnet_18_ssd | deep neural net | Images | Convolutional network for object detection with ResNet-18 base
1349+
resnet_34_ssd | deep neural net | Images | Convolutional network for object detection with ResNet-34 base
1350+
segnet | deep neural net | Images | Convolutional network for segmentation
1351+
se_net | deep neural net | Images | Convolutional network for segmentation
1352+
se_resnet_50 | deep neural net | Images | Convolutional network for image classification
1353+
se_resnet_101 | deep neural net | Images | Convolutional network for image classification
1354+
se_resnet_152 | deep neural net | Images | Convolutional network for image classification
1355+
se_resnext_50 | deep neural net | Images | Convolutional network for image classification
1356+
se_resnext_101 | deep neural net | Images | Convolutional network for image classification
1357+
se_resnet_50_ssd | deep neural net | Images | Convolutional network for image classification
1358+
shufflenet | deep neural net | Images | Lightweight network for image classification
1359+
squeezenet | deep neural net | Images | Lightweight network for image classification
1360+
squeezenet_ssd | deep neural net | Images | Lightweight network for object detection
1361+
ssd_300 | deep neural net | Images | Convolutional network for object detection
1362+
ssd_300_res_128 | deep neural net | Images | Convolutional network for object detection wit ResNet tip
1363+
ssd_512 | deep neural net | Images | Convolutional network for object detection
1364+
ssd_512_res_128 | deep neural net | Images | Convolutional network for object detection with ResNet tip
1365+
unet | deep neural net | Images | Convolutional network for segmentation
1366+
vdcnn_17 | deep neural net | Images | Convolutional network for text classification
1367+
vdcnn_9 | deep neural net | Images | Convolutional network for text classification
1368+
vgg_16 | deep neural net | Images | Convolutional network for image classification
13141369
13151370
## Parameters
13161371
@@ -1322,7 +1377,7 @@ nclasses | int | no (classification only) | N/A | Number of ou
13221377
ntargets | int | no (regression only) | N/A | Number of regression targets
13231378
template | string | yes | empty | Neural network template, from "lregression", "mlp", "convnet", "alexnet", "googlenet", "nin"
13241379
layers | array of int | yes | [50] | Number of neurons per layer ("mlp" only)
1325-
layers | array of string | yes | [1000] | Type of layer and number of neurons peer layer: XCRY for X successive convolutional layers of Y filters with activation layers followed by a max pooling layer, an int as a string for specifying the final fully connected layers size, e.g. \["2CR32","2CR64","1000"\] ("convnet" only)
1380+
layers | array of string | yes | [1000] | Type of layer and number of neurons peer layer: XCRY for X successive convolutional layers of Y filters with activation layers followed by a max pooling layer, an int as a string for specifying the final fully connected layers size, e.g. \["2CR32","2CR64","1000"\] ("convnet" only), ["L50","L50"] means 2 layers of LSTMs with hidden size of 50. ["L100","L100", "T", "L300"] means an lstm autoencoder with encoder composed of 2 LSTM layers of hidden size 100 and decoder is one LSTM layer of hidden size 300 ("recurrent" only)
13261381
activation | string | yes | relu | Unit activation ("mlp" and "convnet" only), from "sigmoid","tanh","relu","prelu"
13271382
dropout | real | yes | 0.5 | Dropout rate between layers ("mlp" and "convnet" only)
13281383
regression | bool | yes | false | Whether the model is a regressor ("mlp" and "convnet" only)

0 commit comments

Comments
 (0)