Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
6c9010ef
Unverified
Commit
6c9010ef
authored
Mar 10, 2022
by
Sanchit Gandhi
Committed by
GitHub
Mar 10, 2022
Browse files
Update README.md
parent
fde90187
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
examples/research_projects/jax-projects/README.md
examples/research_projects/jax-projects/README.md
+2
-1
No files found.
examples/research_projects/jax-projects/README.md
View file @
6c9010ef
...
...
@@ -780,7 +780,8 @@ def cross_entropy(logits, labels):
# define a function which will run the forward pass return loss
def
compute_loss
(
params
,
input_ids
,
labels
):
logits
=
model
(
input_ids
,
params
=
params
,
train
=
True
)
loss
=
cross_entropy
(
logits
,
onehot
(
labels
)).
mean
()
num_classes
=
logits
.
shape
[
-
1
]
loss
=
cross_entropy
(
logits
,
onehot
(
labels
,
num_classes
)).
mean
()
return
loss
```
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment