Skip to content

Commit

Permalink
Improve RNN
Browse files Browse the repository at this point in the history
  • Loading branch information
orifmilod committed May 12, 2024
1 parent dfec1a3 commit 49bffbd
Show file tree
Hide file tree
Showing 5 changed files with 924 additions and 145 deletions.
101 changes: 40 additions & 61 deletions example/language_model/pytorch/name_classification/rnn.ipynb

Large diffs are not rendered by default.

196 changes: 142 additions & 54 deletions example/language_model/pytorch/next_word_prediction/rnn.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gigatorch/loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import numpy as np


def squared_loss(ys, y_pred):
def squared_loss(ys: Tensor, y_pred: Tensor) -> Tensor:
return sum([(y_pred - y_target) ** 2 for y_target, y_pred in zip(ys, y_pred)])


Expand Down
Loading

0 comments on commit 49bffbd

Please sign in to comment.