Skip to content

Commit

Permalink
added torch.nn
Browse files Browse the repository at this point in the history
  • Loading branch information
wonchul-kim committed Jan 20, 2024
1 parent 5828861 commit eeeb483
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions _posts/pytorch/2024-01-21-torch-nn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
layout: post
title: nn.Module, nn.Sequential, nn.ModuleList, nn.ModuleDict
category: Pytorch
tag: torch.nn
---

- Use `Module` when you have a big block compose of multiple smaller blocks
- Use `Sequential` when you want to create a small block from layers
- Use `ModuleList` when you need to iterate through some layers or building blocks and do something
- Use `ModuleDict` when you need to parametise some blocks of your model, for example an activation function

### references:
- https://github.com/FrancescoSaverioZuppichini/Pytorch-how-and-when-to-use-Module-Sequential-ModuleList-and-ModuleDict

0 comments on commit eeeb483

Please sign in to comment.