Summary of AI Learning Catalog
1. Customize the network layer
Customizing the network layer is easy and can be completed in three steps
- Inherited class: nn.Module
- Define the initialization function: define the code that needs to be initialized in __init__
- Define forward propagation function: forward
1.1 Network layer without parameters
1) Define the network layer
import torch
import torch.nn.functional as F
from torch import nn
class CenteredLayer(nn.Module)