All tutorials
    Model Builder
    Beginner
    30 min

    From Template to Trained Model in the Model Builder

    Start from a template, read the problems and resources tabs, train in the browser, see what the run kept, then freeze layers and start from your own weights.

    What you will do

    Build and train a network without writing code, read the builder's feedback, and then reuse the trained model as a starting point.

    Before you start

    Step 1: Pick a dataset and start from a template

    Open the Model Builder. Choose the dataset in the header. Start from one of the templates (LeNet, a VGG-style stack, a ResNet-style network or an LSTM) for image or sequence data, or add layers one at a time for tabular data: drag Dense from the layer rail onto the canvas, or press Ctrl K, type the layer name and press Enter.

    Step 2: Connect and configure

    Drag from the port under one layer to the port above the next. Select a layer to open its inspector: size, activation and other settings. The Output layer picks its target from your dataset's columns, and choosing one sets the task type and loss that column calls for.

    Step 3: Read the feedback

    The status line at the bottom of the canvas counts problems. Open the Problems tab: it lists, for example, a layer with no input, or an Input that does not match the dataset's feature columns, and offers a one-click fix where there is one. Open Resources to see every layer's output shape, parameters and share of the total.

    Step 4: Check the memory estimate

    The builder estimates the memory a run needs, holding parameters three times over while training and adding the activations kept for the backward pass, which grow with the batch size. It compares this with a budget. A browser cannot report GPU memory, so the budget is an assumption you can replace with your real figure in Resources.

    Step 5: Train

    Set epochs, batch size, early stopping and checkpoints under Training; the builder explains in plain words what the generated code will do. Press Train. If memory is tight, you are shown where it goes and offered changes (a narrower hidden layer, a smaller batch). Apply & train makes them as one undoable edit; Train anyway leaves the model alone. Loss and accuracy are charted epoch by epoch in the dock under the canvas, and Stop ends the run.

    Step 6: See what was kept

    When the run ends, the top of the Run tab says what was kept and where. The model is stored in the project folder when one is open, otherwise in the browser. Three buttons carry it on: Fine-tune, Deploy and add to pipeline.

    Step 7: Try transfer learning

    Select a layer and turn Trainable off to freeze it (a lock appears on its card). Freeze everything above here freezes a layer and everything above it. The parameter count splits into trainable and frozen, and the memory estimate drops. Now delete the final layers, add new ones, and in Training set Start from to your trained model. Weights are matched to layers by name; layers that are new or whose shape changed start fresh, and the dialog tells you which.

    Step 8: Look at the code

    Open the Code tab to see the generated TensorFlow.js (or Keras, if you chose an attached kernel). Press Generate Code to keep a copy as a project file, then edit it in the Code Editor. JSON exports the graph itself so you can share it.

    Where to go next

    Try it in DLWΛY

    Open the Studio and follow along in a real project. There is nothing to install.

    Open Studio