Comments (9)
Tribuo needs to know what the mapping is from the feature names it produces to the feature indices that the ONNX model expects. If your model expects a feature vector (rather than an image or some other kind of structured input) then you need to pass in a DenseTransformer
to the ONNXExternalModel
, along with the string -> int mapping. The feature names are user controlled in some senses, they either come from the headers/field names of the csv/db/json data, or are constructed as the string representation of padded indices (i.e. 000
, 001
etc).
For your example with a feature vector of [2][7]
is that a batch size of 2 and a 7 element feature vector?
from tribuo.
Yes @Craigacp, the 2 is a batch. So it really needs a float array with 7 elements as input.
from tribuo.
Ok, so you'd want to make a Tribuo example containing those 7 features, with appropriate names. Those can be semantic ones if the features actually have names, or just 00
,...,06
, then supply the mapping as appropriate.
from tribuo.
okay, but what about the key "input" do I not need that in tribuo?
from tribuo.
It's the last argument when constructing an ONNXExternalModel
- https://tribuo.org/learn/4.3/javadoc/org/tribuo/interop/onnx/ONNXExternalModel.html#createOnnxModel(org.tribuo.OutputFactory,java.util.Map,java.util.Map,org.tribuo.interop.onnx.ExampleTransformer,org.tribuo.interop.onnx.OutputTransformer,ai.onnxruntime.OrtSession.SessionOptions,java.nio.file.Path,java.lang.String).
from tribuo.
Oh I see. And at inference time what should be the format of my input? What type of object and what function should I be using to run inference on the Model object? @Craigacp
from tribuo.
The model exposes a predict
function which accepts Iterable<Example<T>>
or Example<T>
, returning Prediction<T>
which contains the predicted values and any confidence scores produced by the model.
from tribuo.
Any code example which shows how to build an Example object from raw values?
from tribuo.
Not specifically, but you can see how the examples are built in all the DataSource
implementations, e.g. this one for loading in LibSVM format data - https://github.com/oracle/tribuo/blob/main/Core/src/main/java/org/tribuo/datasource/LibSVMDataSource.java#L348.
from tribuo.
Related Issues (20)
- getClusters in HDBSCAN transformed model HOT 2
- Import CARTClassificationTrainer without using tribuo-all HOT 2
- Error on irises-tribuo-v4.ipynb HOT 1
- TransformedModel doesn't have a protobuf
- mRMR HOT 1
- FS using wrapper approaches HOT 7
- Docs recommending IJava HOT 2
- Problem deserializing the XGBoostModel HOT 1
- Do you have any plans to support time-series predictions? HOT 1
- When packaged into docker container: FileNotFoundException: File /lib/linux-musl/x86_64/libxgboost4j.so HOT 6
- Memory and SQLDataSource HOT 1
- About csvLoader.loadDataSource HOT 4
- Configuring HyperParameters HOT 4
- Llama APIs HOT 1
- Load data from List obj in memory HOT 1
- MLP HOT 1
- TensorFlow Isuue
- Training loss HOT 1
- Weight and Bias in NN HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tribuo.