The Read Pixels Function is used to provide indexed access to an embedding over 2 dimensions.
A new function of type image.readpixels
named <id>
can be created as follows:
mldb.put("/v1/functions/"+<id>, {
"type": "image.readpixels",
"params": {
"expression": <string>
}
})
with the following key-value definitions for params
:
Field, Type, Default | Description |
---|---|
expression | SQL Expression that will evaluate to the embedding we want to provide access to |
The following function configuration will provide indexed access over the 2x2 embedding specified.
{
"id": "expr",
"type": "image.wrapper",
"params": {
"expression": "[[[1],[2]],[[3],[4]]]"
}
}
The expression expr(0,1)
will return the value 2
from the embedding.
sql.query
function type runs an SQL query against a
dataset when it is called.