18 lines
378 B
JavaScript
18 lines
378 B
JavaScript
|
|
export class ModelState {
|
||
|
|
|
||
|
|
constructor() {
|
||
|
|
|
||
|
|
this.config = null;
|
||
|
|
|
||
|
|
// embeddings
|
||
|
|
this.tokenEmbedding = null;
|
||
|
|
this.positionEmbedding = null;
|
||
|
|
|
||
|
|
// transformer layers
|
||
|
|
this.layers = []; // each layer: { Wq,Wk,Wv,bq,bk,bv, Wout,bout, Wfc1,bfc1, Wfc2,bfc2 }
|
||
|
|
|
||
|
|
// tied output projection
|
||
|
|
this.Wlogits = null;
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|