Package io.github.kirstenali.deepj.nn
Record Class TransformerEncoderConfig
java.lang.Object
java.lang.Record
io.github.kirstenali.deepj.nn.TransformerEncoderConfig
public record TransformerEncoderConfig(int width, int heads, int hiddenSize, int layers, float dropout)
extends Record
Pre-normalized encoder dimensions. Input embeddings supply their chosen positional representation.
-
Constructor Summary
ConstructorsConstructorDescriptionTransformerEncoderConfig(int width, int heads, int hiddenSize, int layers, float dropout) Creates an instance of aTransformerEncoderConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloatdropout()Returns the value of thedropoutrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intheads()Returns the value of theheadsrecord component.intReturns the value of thehiddenSizerecord component.intlayers()Returns the value of thelayersrecord component.final StringtoString()Returns a string representation of this record class.intwidth()Returns the value of thewidthrecord component.
-
Constructor Details
-
TransformerEncoderConfig
public TransformerEncoderConfig(int width, int heads, int hiddenSize, int layers, float dropout) Creates an instance of aTransformerEncoderConfigrecord class.- Parameters:
width- the value for thewidthrecord componentheads- the value for theheadsrecord componenthiddenSize- the value for thehiddenSizerecord componentlayers- the value for thelayersrecord componentdropout- the value for thedropoutrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='. -
width
public int width()Returns the value of thewidthrecord component.- Returns:
- the value of the
widthrecord component
-
heads
public int heads()Returns the value of theheadsrecord component.- Returns:
- the value of the
headsrecord component
-
layers
public int layers()Returns the value of thelayersrecord component.- Returns:
- the value of the
layersrecord component
-
dropout
public float dropout()Returns the value of thedropoutrecord component.- Returns:
- the value of the
dropoutrecord component
-