make figures for appendix d

This commit is contained in:
rasbt
2024-03-31 21:22:49 -05:00
parent ee096986ea
commit ac2bdb02bd
3 changed files with 74 additions and 19 deletions

17
.gitignore vendored
View File

@@ -1,11 +1,20 @@
ch05/01_main-chapter-code/gpt2/
# Graphics
appendix-D/01_main-chapter-code/1.pdf
appendix-D/01_main-chapter-code/2.pdf
appendix-D/01_main-chapter-code/3.pdf
ch05/01_main-chapter-code/loss-plot.pdf
ch05/01_main-chapter-code/model.pth
ch05/01_main-chapter-code/model_and_optimizer.pth
ch05/01_main-chapter-code/temperature-plot.pdf
ch05/02_alternative_weight_loading/checkpoints
ch05/01_main-chapter-code/the-verdict.txt
# Checkpoint files
ch05/01_main-chapter-code/gpt2/
ch05/02_alternative_weight_loading/checkpoints
ch05/01_main-chapter-code/model.pth
ch05/01_main-chapter-code/model_and_optimizer.pth
# Temporary OS-related files
.DS_Store
# Byte-compiled / optimized / DLL files

File diff suppressed because one or more lines are too long

View File

@@ -308,7 +308,7 @@ def plot_losses(epochs_seen, tokens_seen, train_losses, val_losses):
ax2.set_xlabel("Tokens seen")
fig.tight_layout() # Adjust layout to make room
plt.show()
#plt.show()
def text_to_token_ids(text, tokenizer):