File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 32
32
y = torch .zeros (3 ) # expected output
33
33
w = torch .randn (5 , 3 , requires_grad = True )
34
34
b = torch .randn (3 , requires_grad = True )
35
- z = torch .matmul (x , w )+ b
35
+ z = torch .matmul (x , w ) + b
36
36
loss = torch .nn .functional .binary_cross_entropy_with_logits (z , y )
37
37
38
38
133
133
# - To mark some parameters in your neural network as **frozen parameters**.
134
134
# - To **speed up computations** when you are only doing forward pass, because computations on tensors that do
135
135
# not track gradients would be more efficient.
136
- # For additional reference, you can view the autograd mechanics
136
+ # For additional reference, you can view the autograd mechanics
137
137
# documentation:https://docs.pytorch.org/docs/stable/notes/autograd.html#locally-disabling-gradient-computation
138
138
139
139
######################################################################
171
171
#
172
172
# 2. Torchviz
173
173
# Torchviz is a package to render the computational graph visually.
174
- #
174
+ #
175
175
# We can generate an image for the computational graph in the example given below:
176
176
#
177
177
# import torch
You can’t perform that action at this time.
0 commit comments