Record Class GPTConfig
java.lang.Object
java.lang.Record
io.github.kirstenali.deepj.models.gpt.GPTConfig
- All Implemented Interfaces:
TransformerConfig
public record GPTConfig(int vocabSize, int maxSeqLen, int dModel, int nHeads, int nLayers, int dFF, float initScale, float gradClipNorm)
extends Record
implements TransformerConfig
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintdFF()Returns the value of thedFFrecord component.intdModel()Returns the value of thedModelrecord component.final booleanIndicates whether some other object is "equal to" this one.floatReturns the value of thegradClipNormrecord component.final inthashCode()Returns a hash code value for this object.floatReturns the value of theinitScalerecord component.intReturns the value of themaxSeqLenrecord component.intnHeads()Returns the value of thenHeadsrecord component.intnLayers()Returns the value of thenLayersrecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thevocabSizerecord component.
-
Constructor Details
-
GPTConfig
public GPTConfig(int vocabSize, int maxSeqLen, int dModel, int nHeads, int nLayers, int dFF) -
GPTConfig
public GPTConfig(int vocabSize, int maxSeqLen, int dModel, int nHeads, int nLayers, int dFF, float initScale, float gradClipNorm) Creates an instance of aGPTConfigrecord class.- Parameters:
vocabSize- the value for thevocabSizerecord componentmaxSeqLen- the value for themaxSeqLenrecord componentdModel- the value for thedModelrecord componentnHeads- the value for thenHeadsrecord componentnLayers- the value for thenLayersrecord componentdFF- the value for thedFFrecord componentinitScale- the value for theinitScalerecord componentgradClipNorm- the value for thegradClipNormrecord 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 '=='. -
vocabSize
public int vocabSize()Returns the value of thevocabSizerecord component.- Specified by:
vocabSizein interfaceTransformerConfig- Returns:
- the value of the
vocabSizerecord component
-
maxSeqLen
public int maxSeqLen()Returns the value of themaxSeqLenrecord component.- Specified by:
maxSeqLenin interfaceTransformerConfig- Returns:
- the value of the
maxSeqLenrecord component
-
dModel
public int dModel()Returns the value of thedModelrecord component.- Specified by:
dModelin interfaceTransformerConfig- Returns:
- the value of the
dModelrecord component
-
nHeads
public int nHeads()Returns the value of thenHeadsrecord component.- Specified by:
nHeadsin interfaceTransformerConfig- Returns:
- the value of the
nHeadsrecord component
-
nLayers
public int nLayers()Returns the value of thenLayersrecord component.- Specified by:
nLayersin interfaceTransformerConfig- Returns:
- the value of the
nLayersrecord component
-
dFF
public int dFF()Returns the value of thedFFrecord component.- Specified by:
dFFin interfaceTransformerConfig- Returns:
- the value of the
dFFrecord component
-
initScale
public float initScale()Returns the value of theinitScalerecord component.- Returns:
- the value of the
initScalerecord component
-
gradClipNorm
public float gradClipNorm()Returns the value of thegradClipNormrecord component.- Specified by:
gradClipNormin interfaceTransformerConfig- Returns:
- the value of the
gradClipNormrecord component
-