Class NeighboursBruteForceFactory
java.lang.Object
org.tribuo.math.neighbour.bruteforce.NeighboursBruteForceFactory
- All Implemented Interfaces:
- com.oracle.labs.mlrg.olcut.config.Configurable,- com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>,- Serializable,- NeighboursQueryFactory,- ProtoSerializable<org.tribuo.math.protos.NeighbourFactoryProto>
A factory which creates brute-force nearest neighbour query objects.
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intProtobuf serialization version.Fields inherited from interface org.tribuo.protos.ProtoSerializableDESERIALIZATION_METHOD_NAME, PROVENANCE_SERIALIZER
- 
Constructor SummaryConstructorsConstructorDescriptionNeighboursBruteForceFactory(Distance distance, int numThreads) Constructs a brute-force nearest neighbor query factory object using the supplied parameters.
- 
Method SummaryModifier and TypeMethodDescriptioncreateNeighboursQuery(SGDVector[] data) Constructs a brute-force nearest neighbor query object using the supplied array ofSGDVector.static NeighboursBruteForceFactorydeserializeFromProto(int version, String className, com.google.protobuf.Any message) Deserialization factory.booleanGets theDistanceset on this object.intGet the number of threads set on this object.inthashCode()voidUsed by the OLCUT configuration system, and should not be called by external code.org.tribuo.math.protos.NeighbourFactoryProtoSerializes this object to a protobuf.Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.tribuo.math.neighbour.NeighboursQueryFactorygetProvenance
- 
Field Details- 
CURRENT_VERSIONpublic static final int CURRENT_VERSIONProtobuf serialization version.- See Also:
 
 
- 
- 
Constructor Details- 
NeighboursBruteForceFactoryConstructs a brute-force nearest neighbor query factory object using the supplied parameters.- Parameters:
- distance- The distance function.
- numThreads- The number of threads to be used to parallelize the computation.
 
 
- 
- 
Method Details- 
deserializeFromProtopublic static NeighboursBruteForceFactory deserializeFromProto(int version, String className, com.google.protobuf.Any message) throws com.google.protobuf.InvalidProtocolBufferException Deserialization factory.- Parameters:
- version- The serialized object version.
- className- The class name.
- message- The serialized data.
- Returns:
- The deserialized object.
- Throws:
- com.google.protobuf.InvalidProtocolBufferException- If the protobuf could not be parsed from the- message.
 
- 
serializepublic org.tribuo.math.protos.NeighbourFactoryProto serialize()Description copied from interface:ProtoSerializableSerializes this object to a protobuf.- Specified by:
- serializein interface- ProtoSerializable<org.tribuo.math.protos.NeighbourFactoryProto>
- Returns:
- The protobuf.
 
- 
createNeighboursQueryConstructs a brute-force nearest neighbor query object using the supplied array ofSGDVector.- Specified by:
- createNeighboursQueryin interface- NeighboursQueryFactory
- Parameters:
- data- An array of- SGDVector.
- Returns:
- A query object.
 
- 
getDistanceDescription copied from interface:NeighboursQueryFactoryGets theDistanceset on this object.- Specified by:
- getDistancein interface- NeighboursQueryFactory
- Returns:
- The distance function.
 
- 
getNumThreadspublic int getNumThreads()Description copied from interface:NeighboursQueryFactoryGet the number of threads set on this object. There could be factory implementations that are sequential, meaning they are single threaded.- Specified by:
- getNumThreadsin interface- NeighboursQueryFactory
- Returns:
- The number of threads used to parallelize the query operation.
 
- 
postConfigpublic void postConfig()Used by the OLCUT configuration system, and should not be called by external code.- Specified by:
- postConfigin interface- com.oracle.labs.mlrg.olcut.config.Configurable
 
- 
equals
- 
hashCode
 
-