Features · Neural networks
Neural networks in BESSER.
Model and generate neural networks within the same BESSER low-code workflow. Define your architecture, validate it, and generate runnable PyTorch or TensorFlow code at the click of a button.
Prefer to watch? Jump to the 3-min walkthrougheditor.besser-pearl.org — CIFAR-10 CNN
From model to code
The same model, generated for your framework.
Pick PyTorch or TensorFlow, subclassing or sequential — the generator writes the architecture, training loop and evaluation for you.
generated/pytorch/model.py
# Define the network architecture
class NeuralNetwork(nn.Module):
def __init__(self):
super().__init__()
self.l1 = nn.Conv2d(in_channels=3, out_channels=32, kernel_size=(3, 3), stride=(1, 1), padding=0)
self.actv_func_relu = nn.ReLU()
self.l2 = nn.MaxPool2d(kernel_size=(2, 2), stride=(2, 2), padding=0)
self.l3 = nn.Conv2d(in_channels=32, out_channels=64, kernel_size=(3, 3), stride=(1, 1), padding=0)
self.l4 = nn.MaxPool2d(kernel_size=(2, 2), stride=(2, 2), padding=0)
self.l5 = nn.Conv2d(in_channels=64, out_channels=64, kernel_size=(3, 3), stride=(1, 1), padding=0)
self.l6 = nn.Flatten(start_dim=1, end_dim=-1)
self.l7 = nn.Linear(in_features=1024, out_features=64)
self.l8 = nn.Linear(in_features=64, out_features=10)
def forward(self, x):
x = self.l1(x)
x = self.actv_func_relu(x)
x = self.l2(x)
x = self.l3(x)
x = self.actv_func_relu(x)
x = self.l4(x)
x = self.l5(x)
x = self.actv_func_relu(x)
x = self.l6(x)
x = self.l7(x)
x = self.actv_func_relu(x)
x = self.l8(x)
return x
# … plus dataset prep, the training loop, evaluation & model saving Real generated code for the CIFAR-10 CNN — toggle PyTorch / TensorFlow.
Capabilities
Everything you need to model a network.
From an abstract, framework-agnostic model to runnable training code — validated along the way.
Walkthrough
Watch it end to end
Model a CIFAR-10 CNN on the canvas, then generate the PyTorch or TensorFlow training code — in one short take.
editor.besser-pearl.org — model → generate