From 6667fe61161c500cc7f6c1d5b7c8fd8e21b0f164 Mon Sep 17 00:00:00 2001 From: Jakub Date: Thu, 19 Dec 2024 01:08:25 +0100 Subject: [PATCH] Full En-/Decoding for NLP with example vocab --- src/model/decoder.rs | 2 +- src/model/encoder.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/model/decoder.rs b/src/model/decoder.rs index 23b6855..bfd1e23 100644 --- a/src/model/decoder.rs +++ b/src/model/decoder.rs @@ -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::::zeros((d_model, d_model)); // Replace with actual learned parameters + let dummy_learned_matrices = Array2::::ones((d_model, d_model)); // Replace with actual learned parameters let attention_output = multi_head_attention( input.clone(), // Q input.clone(), // K diff --git a/src/model/encoder.rs b/src/model/encoder.rs index b474101..0d52c33 100644 --- a/src/model/encoder.rs +++ b/src/model/encoder.rs @@ -28,7 +28,7 @@ pub fn encoding( let d_model = input.shape()[2]; // Multi-Head Attention - let dummy_learned_matrices = Array2::::zeros((d_model, d_model)); // Replace with actual learned parameters + let dummy_learned_matrices = Array2::::ones((d_model, d_model)); // Replace with actual learned parameters let attention_output = multi_head_attention( input.clone(), // Q input.clone(), // K