Skip to content
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

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

ericgeiger1
Copy link

@ericgeiger1 ericgeiger1 commented Dec 28, 2024

Description

Issue Solved

Closes #5864

Type of Change

  • Adding a new entry
  • Editing an existing entry (fixing a typo, bug, issues, etc)
  • Updating the documentation

Checklist

  • All writings are my own.
  • My entry follows the Codecademy Docs style guide.
  • My changes generate no new warnings.
  • I have performed a self-review of my own writing and code.
  • I have checked my entry and corrected any misspellings.
  • I have made corresponding changes to the documentation if needed.
  • I have confirmed my changes are not being pushed from my forked main branch.
  • I have confirmed that I'm pushing from a new branch named after the changes I'm making.
  • I have linked any issues that are relevant to this PR in the Issues Solved section.

@CLAassistant
Copy link

CLAassistant commented Dec 28, 2024

CLA assistant check
All committers have signed the CLA.

@ericgeiger1
Copy link
Author

Waiting for approval on the issue, finished the project and just need to make the pull request and wait for review.

@PragatiVerma18 PragatiVerma18 self-assigned this Jan 8, 2025
Copy link
Collaborator

@PragatiVerma18 PragatiVerma18 left a 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.

Copy link
Collaborator

@PragatiVerma18 PragatiVerma18 left a 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! 🚀

Copy link
Author

@ericgeiger1 ericgeiger1 left a 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!


## 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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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


Copy link
Collaborator

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.
Copy link
Collaborator

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```python
```py


> **Note**: Each run generates random values for `x`, so the exact output will vary.

## Advantages of Using Functional APIs
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Advantages of Using Functional APIs
## Advantages of Using Functional API

@Radhika-okhade
Copy link
Collaborator

Radhika-okhade commented Jan 15, 2025

Hey @ericgeiger1, Thanks for contributing to Codecademy docs. I have some suggestions; please go through them and make the required changes.
Also, correct the file path. This is the correct one docs/content/pytorch/concepts/using-functional-api/using-functional-api.md

@Radhika-okhade Radhika-okhade added status: waiting for author and removed status: under review Issue or PR is currently being reviewed labels Jan 15, 2025
ericgeiger1 and others added 7 commits January 18, 2025 00:55
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Concept Entry] PyTorch: Using Functional API
4 participants