Package org.tribuo.math.kernel
Class Sigmoid
java.lang.Object
org.tribuo.math.kernel.Sigmoid
- 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
,Kernel
,ProtoSerializable<org.tribuo.math.protos.KernelProto>
A sigmoid kernel, tanh(gamma*u.dot(v) + intercept).
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Protobuf serialization version.Fields inherited from interface org.tribuo.protos.ProtoSerializable
DESERIALIZATION_METHOD_NAME, PROVENANCE_SERIALIZER
-
Constructor Summary
ConstructorDescriptionSigmoid
(double gamma, double intercept) A sigmoid kernel, tanh(gamma*u.dot(v) + intercept). -
Method Summary
Modifier and TypeMethodDescriptionstatic Sigmoid
deserializeFromProto
(int version, String className, com.google.protobuf.Any message) Deserialization factory.boolean
com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance
int
hashCode()
org.tribuo.math.protos.KernelProto
Serializes this object to a protobuf.double
Calculates the similarity between twoSparseVector
s.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.oracle.labs.mlrg.olcut.config.Configurable
postConfig
-
Field Details
-
CURRENT_VERSION
public static final int CURRENT_VERSIONProtobuf serialization version.- See Also:
-
-
Constructor Details
-
Sigmoid
public Sigmoid(double gamma, double intercept) A sigmoid kernel, tanh(gamma*u.dot(v) + intercept).- Parameters:
gamma
- A scalar coefficient.intercept
- An additive coefficient.
-
-
Method Details
-
deserializeFromProto
public static Sigmoid 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 themessage
.
-
serialize
public org.tribuo.math.protos.KernelProto serialize()Description copied from interface:ProtoSerializable
Serializes this object to a protobuf.- Specified by:
serialize
in interfaceProtoSerializable<org.tribuo.math.protos.KernelProto>
- Returns:
- The protobuf.
-
similarity
Description copied from interface:Kernel
Calculates the similarity between twoSparseVector
s.- Specified by:
similarity
in interfaceKernel
- Parameters:
a
- The first SparseVector.b
- The second SparseVector.- Returns:
- A value between 0 and 1, where 1 is most similar and 0 is least similar.
-
toString
-
getProvenance
public com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance getProvenance()- Specified by:
getProvenance
in interfacecom.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
-
equals
-
hashCode
public int hashCode()
-