Loading...
Create a basic neural network class by subclassing nn.Module.
In PyTorch, neural networks are defined by subclassing nn.Module. You define the layers in the constructor and specify how data flows through them in the forward method.
Write a function create_simple_network() that defines a single-layer neural network (10 inputs → 5 outputs) and returns a dictionary describing the network.
Return a dictionary with keys: "class_name" (string), "is_module" (boolean), "output_shape" (list — shape when given a single sample of 10 features).
None
{'class_name': 'SimpleNet', 'is_module': True, 'output_shape': [1, 5]}SimpleNet inherits from nn.Module with one Linear(10,5) layer