Interface EnsembleCombiner<T extends Output<T>>
- All Superinterfaces:
com.oracle.labs.mlrg.olcut.config.Configurable
,ProtoSerializable<org.tribuo.protos.core.EnsembleCombinerProto>
,com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
,Serializable
- All Known Implementing Classes:
AveragingCombiner
,FullyWeightedVotingCombiner
,MultiLabelVotingCombiner
,VotingCombiner
-
Field Summary
Fields inherited from interface org.tribuo.protos.ProtoSerializable
DESERIALIZATION_METHOD_NAME, PROVENANCE_SERIALIZER
-
Method Summary
Modifier and TypeMethodDescriptioncombine
(ImmutableOutputInfo<T> outputInfo, List<Prediction<T>> predictions) Combine the predictions.combine
(ImmutableOutputInfo<T> outputInfo, List<Prediction<T>> predictions, float[] weights) Combine the supplied predictions.static EnsembleCombiner<?>
deserialize
(org.tribuo.protos.core.EnsembleCombinerProto proto) Deserialization helper for EnsembleCombiner.default ONNXNode
exportCombiner
(ONNXNode input) Exports this ensemble combiner into the ONNX context of its input.exportCombiner
(ONNXNode input, U weight) Exports this ensemble combiner into the ONNX context of its input.The type witness used when deserializing the combiner from a protobuf.Methods inherited from interface com.oracle.labs.mlrg.olcut.config.Configurable
postConfig
Methods inherited from interface org.tribuo.protos.ProtoSerializable
serialize
Methods inherited from interface com.oracle.labs.mlrg.olcut.provenance.Provenancable
getProvenance
-
Method Details
-
combine
Combine the predictions.- Parameters:
outputInfo
- The output domain.predictions
- The predictions to combine.- Returns:
- The ensemble prediction.
-
combine
Prediction<T> combine(ImmutableOutputInfo<T> outputInfo, List<Prediction<T>> predictions, float[] weights) Combine the supplied predictions. predictions.size() must equal weights.length.- Parameters:
outputInfo
- The output domain.predictions
- The predictions to combine.weights
- The weights to use for each prediction.- Returns:
- The ensemble prediction.
-
exportCombiner
Exports this ensemble combiner into the ONNX context of its input.The input should be a 3-tensor [batch_size, num_outputs, num_ensemble_members].
For compatibility reasons this method has a default implementation, though when called it will throw an
IllegalStateException
. In a future version this method will not have a default implementation and ensemble combiners will be required to provide ONNX support.- Parameters:
input
- the node to be ensembled according to this implementation.- Returns:
- The leaf node of the graph of operations added to ensemble input.
-
exportCombiner
Exports this ensemble combiner into the ONNX context of its input.The input should be a 3-tensor [batch_size, num_outputs, num_ensemble_members].
For compatibility reasons this method has a default implementation, though when called it will throw an
IllegalStateException
. In a future version this method will not have a default implementation and ensemble combiners will be required to provide ONNX support.- Type Parameters:
U
- The type of the weights input reference.- Parameters:
input
- the node to be ensembled according to this implementation.weight
- The node of weights for ensembling.- Returns:
- The leaf node of the graph of operations added to ensemble input.
-
getTypeWitness
The type witness used when deserializing the combiner from a protobuf.The default implementation throws
UnsupportedOperationException
for compatibility with implementations which don't use protobuf serialization. This implementation will be removed in the next major version of Tribuo.- Returns:
- The output class this object produces.
-
deserialize
Deserialization helper for EnsembleCombiner.- Parameters:
proto
- The proto to deserialize.- Returns:
- The combiner.
-