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

PyTorch nn Layers entry #5586

Merged
merged 39 commits into from
Nov 15, 2024
Merged
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
7053eb6
created dir and initial document
DigitalDruid10010110 Oct 26, 2024
4021a02
added term entry template to layers.md
DigitalDruid10010110 Oct 26, 2024
91d89f0
completed meta data section with all fields updated with revelant inf…
DigitalDruid10010110 Oct 26, 2024
f109189
updated description section
DigitalDruid10010110 Oct 31, 2024
2757e31
updated description section
DigitalDruid10010110 Oct 31, 2024
a274314
finished syntax and example sections
DigitalDruid10010110 Nov 1, 2024
b4cf8de
cleaned up document spacing
DigitalDruid10010110 Nov 1, 2024
8000900
cleaned up document spacing, fixed errors and typos
DigitalDruid10010110 Nov 1, 2024
d5dcd9d
deleted addon created file and document not associated with the prject
DigitalDruid10010110 Nov 1, 2024
9e94a60
Merge branch 'main' into add-layers-entry
DigitalDruid10010110 Nov 1, 2024
26ca2b7
Merge branch 'main' into add-layers-entry
DigitalDruid10010110 Nov 2, 2024
a184d23
Merge branch 'main' into add-layers-entry
DigitalDruid10010110 Nov 3, 2024
f13d5b0
Merge branch 'main' into add-layers-entry
DigitalDruid10010110 Nov 5, 2024
a76a8a2
Update content/pytorch/concepts/nn/terms/layers/layers.md
DigitalDruid10010110 Nov 5, 2024
7aee700
Update content/pytorch/concepts/nn/terms/layers/layers.md
DigitalDruid10010110 Nov 5, 2024
86f174b
Updated Opening paragraph per suggestion
DigitalDruid10010110 Nov 5, 2024
9ed148a
Updated description to reflect opening paragraph
DigitalDruid10010110 Nov 5, 2024
d032dec
Updated syntax paragraph to suggested change
DigitalDruid10010110 Nov 5, 2024
7a64553
Update content/pytorch/concepts/nn/terms/layers/layers.md
DigitalDruid10010110 Nov 5, 2024
2908535
Update content/pytorch/concepts/nn/terms/layers/layers.md
DigitalDruid10010110 Nov 5, 2024
875aac9
Update content/pytorch/concepts/nn/terms/layers/layers.md
DigitalDruid10010110 Nov 5, 2024
be06617
Merge branch 'main' into add-layers-entry
DigitalDruid10010110 Nov 7, 2024
38ebdc6
Merge branch 'main' into add-layers-entry
DigitalDruid10010110 Nov 7, 2024
6578f91
Merge branch 'main' into add-layers-entry
DigitalDruid10010110 Nov 8, 2024
0e01e17
Merge branch 'main' into add-layers-entry
DigitalDruid10010110 Nov 8, 2024
138b62a
Merge branch 'main' into add-layers-entry
DigitalDruid10010110 Nov 10, 2024
9a60530
Merge branch 'main' into add-layers-entry
DigitalDruid10010110 Nov 11, 2024
6c53731
Merge branch 'main' into add-layers-entry
DigitalDruid10010110 Nov 11, 2024
c851561
Merge branch 'main' into add-layers-entry
DigitalDruid10010110 Nov 12, 2024
9047632
Merge branch 'main' into add-layers-entry
DigitalDruid10010110 Nov 13, 2024
dd695b4
Update content/pytorch/concepts/nn/terms/layers/layers.md
DigitalDruid10010110 Nov 13, 2024
b3b7b47
Merge branch 'main' into add-layers-entry
Radhika-okhade Nov 15, 2024
7edd2ad
Update content/pytorch/concepts/nn/terms/layers/layers.md
Radhika-okhade Nov 15, 2024
8951383
Update layers.md
Radhika-okhade Nov 15, 2024
ca390b8
Merge branch 'main' into add-layers-entry
Radhika-okhade Nov 15, 2024
87892de
Update layers.md
Radhika-okhade Nov 15, 2024
d6e0cc8
Update layers.md
Radhika-okhade Nov 15, 2024
981f683
Update layers.md
mamtawardhani Nov 15, 2024
7b449f5
Merge branch 'main' into add-layers-entry
mamtawardhani Nov 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions content/pytorch/concepts/nn/terms/layers/layers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
Title: 'Layers'
Description: 'Layers are modules that perform operations on input data to build neural networks.'
Subjects:
- 'AI'
- 'Machine Learning'
Tags:
- 'AI'
- 'Deep Learning'
- 'Machine Learning'
- 'Models'
- 'Neural Networks'
CatalogContent:
- 'learn-intro-to-py-torch-and-neural-networks'
- 'py-torch-for-classification'
- 'paths/machine-learning'
---

**Layers** are modules that perform operations on input data to build neural networks.

## Syntax

By using PyTorch's `.Sequential()` method to build a neural network, we can specify layers and activation functions in sequence from input to output as shown below:

```pseudo
import torch
import torch.nn as nn

# Define the model for the neural network
model = nn.Sequential(
# Define layers and activation functions here
nn.Linear(in_features, out_features),
nn.ReLU(),
nn.Linear(in_features, out_features)
)
```

## Example

Below is an example of a basic multi-layer neural network defined using PyTorch's `nn.Sequential()` method, where the data is processed through a specified sequence of layers and activation functions:

```py
import torch
import torch.nn as nn

model = nn.Sequential(
# First layer: Linear transformation from 56 input features to 128 output features
nn.Linear(56, 128), # This layer learns to transform input data
nn.ReLU(), # Activation function to introduce non-linearity

# Second layer: Linear transformation from 128 input features to 26 output features
nn.Linear(128, 26), # This layer continues to transform the data
nn.ReLU(), # Another activation function for non-linearity

# Third layer: Linear transformation from 26 input features to 1 output feature
nn.Linear(26, 1) # Final output layer that produces the model's prediction
)
```
Loading