updated setup.sh

This commit is contained in:
2026-07-02 05:51:44 +00:00
parent d78acd3ba7
commit 5009183c67
3 changed files with 17 additions and 3 deletions
+4
View File
@@ -0,0 +1,4 @@
import tensorflow as tf
print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU')))
print("Is built with CUDA: ", tf.test.is_built_with_cuda())
+3
View File
@@ -1,5 +1,8 @@
#!/bin/bash
git config --global user.email "nathan@hintonclan.org"
git config --global user.name "bionickatana"
# Make virtual env
python3 -m venv venv
+10 -3
View File
@@ -25,8 +25,8 @@ import numpy as np
# ==========================================
# 1. ARCHITECTURE CONFIGURATION
# ==========================================
EMBEDDING_DIM = 512
RNN_UNITS = 512
EMBEDDING_DIM = 64
RNN_UNITS = 256
# Pipeline & Training Hyperparameters
TEXT_FILE = "combined_training_data.txt"
@@ -113,7 +113,7 @@ if os.path.exists(TEXT_FILE):
# ==========================================
class CharacterTextModel(tf.keras.Model):
def __init__(self, vocab_size, embedding_dim, rnn_units, num_layers=2, dropout_rate=0.2):
def __init__(self, vocab_size, embedding_dim, rnn_units, num_layers=2, dropout_rate=0.4):
super().__init__()
self.embedding = tf.keras.layers.Embedding(vocab_size, embedding_dim)
@@ -201,6 +201,13 @@ class GenerationCallback(tf.keras.callbacks.Callback):
checkpoint_prefix = os.path.join(CHECKPOINT_DIR, "ckpt_{epoch}.weights.h5")
checkpoint_callback = tf.keras.callbacks.ModelCheckpoint(filepath=checkpoint_prefix, save_weights_only=True)
# Stop training when validation loss stops improving for 3 epochs
early_stopping = tf.keras.callbacks.EarlyStopping(
monitor='val_loss',
patience=3,
restore_best_weights=True # Automatically rolls back to epoch 15 weights!
)
# ==========================================
# 6. START RUN
# ==========================================