-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added docs/content/pytorch/concepts/using-functional-api/using-functional-api.md #5902
base: main
Are you sure you want to change the base?
Conversation
Waiting for approval on the issue, finished the project and just need to make the pull request and wait for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ericgeiger1, Thanks for contributing to Codecademy docs. I have some suggestions; please go through them and make the required changes. Let me know if you need any help or have any questions.
content/pytorch/concepts/using-functional-apis/using-functional-api.md
Outdated
Show resolved
Hide resolved
content/pytorch/concepts/using-functional-apis/using-functional-api.md
Outdated
Show resolved
Hide resolved
content/pytorch/concepts/using-functional-apis/using-functional-api.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ericgeiger1, this is now ready for a second review! 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is my first pull request!
content/pytorch/concepts/using-functional-apis/using-functional-api.md
Outdated
Show resolved
Hide resolved
content/pytorch/concepts/using-functional-apis/using-functional-api.md
Outdated
Show resolved
Hide resolved
content/pytorch/concepts/using-functional-apis/using-functional-api.md
Outdated
Show resolved
Hide resolved
content/pytorch/concepts/using-functional-apis/using-functional-api.md
Outdated
Show resolved
Hide resolved
content/pytorch/concepts/using-functional-apis/using-functional-api.md
Outdated
Show resolved
Hide resolved
|
||
## Custom Loss Functions | ||
|
||
Using functional APIs, you can easily define custom loss functions. This is useful when the predefined loss functions in PyTorch do not meet your requirements. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using functional APIs, you can easily define custom loss functions. This is useful when the predefined loss functions in PyTorch do not meet your requirements. | |
Using functional API, you can easily define custom loss functions. This is useful when the predefined loss functions in PyTorch do not meet your requirements. |
- Cross-Entropy Loss | ||
- Binary Cross-Entropy Loss | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only one line break is required. Remove the extra line break.
# Apply linear transformation | ||
output = F.linear(x, weight, bias) | ||
``` | ||
The code will output a tensor of shape `(10, 5)` representing the result of the linear transformation. However, the actual values of the tensor will be random due to the use of `torch.randn`, which generates random values from a normal distribution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a line break above this line.
|
||
### Using Linear Transformation | ||
|
||
```python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
```python | |
```py |
|
||
> **Note**: Each run generates random values for `x`, so the exact output will vary. | ||
|
||
## Advantages of Using Functional APIs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Advantages of Using Functional APIs | |
## Advantages of Using Functional API |
content/pytorch/concepts/using-functional-apis/using-functional-api.md
Outdated
Show resolved
Hide resolved
content/pytorch/concepts/using-functional-apis/using-functional-api.md
Outdated
Show resolved
Hide resolved
Hey @ericgeiger1, Thanks for contributing to Codecademy docs. I have some suggestions; please go through them and make the required changes. |
Co-authored-by: Radhika-okhade <radhika.9628@gmail.com>
Co-authored-by: Radhika-okhade <radhika.9628@gmail.com>
Co-authored-by: Radhika-okhade <radhika.9628@gmail.com>
Co-authored-by: Radhika-okhade <radhika.9628@gmail.com>
Co-authored-by: Radhika-okhade <radhika.9628@gmail.com>
Co-authored-by: Radhika-okhade <radhika.9628@gmail.com>
Co-authored-by: Radhika-okhade <radhika.9628@gmail.com>
Description
Issue Solved
Closes #5864
Type of Change
Checklist
main
branch.Issues Solved
section.