Skip to content

Commit

Permalink
Full En-/Decoding for NLP with example vocab
Browse files Browse the repository at this point in the history
  • Loading branch information
JakubSchwenkbeck committed Dec 19, 2024
1 parent fd12f05 commit 6667fe6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/model/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub fn decoding(
let d_model = input.shape()[2];

// Self-Attention (Masked Multi-Head Attention in the Decoder)
let dummy_learned_matrices = Array2::<f32>::zeros((d_model, d_model)); // Replace with actual learned parameters
let dummy_learned_matrices = Array2::<f32>::ones((d_model, d_model)); // Replace with actual learned parameters
let attention_output = multi_head_attention(
input.clone(), // Q
input.clone(), // K
Expand Down
2 changes: 1 addition & 1 deletion src/model/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub fn encoding(
let d_model = input.shape()[2];

// Multi-Head Attention
let dummy_learned_matrices = Array2::<f32>::zeros((d_model, d_model)); // Replace with actual learned parameters
let dummy_learned_matrices = Array2::<f32>::ones((d_model, d_model)); // Replace with actual learned parameters
let attention_output = multi_head_attention(
input.clone(), // Q
input.clone(), // K
Expand Down

0 comments on commit 6667fe6

Please sign in to comment.