Final model upload - BLEU: 0.2490
Browse files- README.md +17 -4
- transformer_model.keras +1 -1
README.md
CHANGED
|
@@ -11,18 +11,31 @@ tags:
|
|
| 11 |
|
| 12 |
# English-Japanese Transformer
|
| 13 |
|
| 14 |
-
|
| 15 |
|
| 16 |
## Performance
|
|
|
|
|
|
|
| 17 |
- **Validation Accuracy**: 0.9088
|
| 18 |
- **Average Character BLEU Score**: 0.2490
|
| 19 |
|
| 20 |
## Usage (Loading Safely)
|
| 21 |
-
|
| 22 |
|
| 23 |
```python
|
| 24 |
import keras
|
| 25 |
-
|
|
|
|
|
|
|
| 26 |
model = keras.models.load_model("transformer_model.keras")
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
```
|
|
|
|
| 11 |
|
| 12 |
# English-Japanese Transformer
|
| 13 |
|
| 14 |
+
A Transformer model trained for English to Japanese machine translation, built using Keras 3.
|
| 15 |
|
| 16 |
## Performance
|
| 17 |
+
The model was trained for 24 epochs, stopping early to prevent overfitting.
|
| 18 |
+
|
| 19 |
- **Validation Accuracy**: 0.9088
|
| 20 |
- **Average Character BLEU Score**: 0.2490
|
| 21 |
|
| 22 |
## Usage (Loading Safely)
|
| 23 |
+
This model is stored in the secure Keras v3 format (`.keras`) and should be loaded as follows:
|
| 24 |
|
| 25 |
```python
|
| 26 |
import keras
|
| 27 |
+
from keras import ops
|
| 28 |
+
|
| 29 |
+
# Load the full model (including architecture and weights)
|
| 30 |
model = keras.models.load_model("transformer_model.keras")
|
| 31 |
+
|
| 32 |
+
# IMPORTANT: You must extract the individual layers/sub-models for step-by-step inference.
|
| 33 |
+
# Example of manual inference call (similar to Cell 3):
|
| 34 |
+
# 1. Get layers:
|
| 35 |
+
# embedding_layer = model.get_layer('token_and_position_embedding')
|
| 36 |
+
# transformer_encoder_layer = model.get_layer('transformer_encoder')
|
| 37 |
+
# decoder_model = model.get_layer('decoder')
|
| 38 |
+
|
| 39 |
+
# 2. Run inference loop with training=False
|
| 40 |
+
# ...
|
| 41 |
```
|
transformer_model.keras
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 95224033
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:aa8625619232535a81db1089ce457052ec28dc4b38c8fafa5b69f39806dbbc58
|
| 3 |
size 95224033
|