Quick overview
Quick overview This workflow exposes two webhooks to train and run inference for a 3-hidden-layer neural network built entirely with n8n Code and Merge nodes, persisting learned weights in workflow static data and returning class probabilities, predictions, and evaluation metrics. How it works Receives a POST request on /train with epochs, learning rate, and an optional dataset to train the network. Runs a vectorized forward and backpropagation pass in JavaScript, updates weights and biases with gradient descent, and stores them in n8n workflow static data. Receives a POST request on /predict containing one or more 8‑dimensional feature vectors (and optional trueClass labels). Computes a feedforward pass through three ReLU hidden layers (9 neurons per layer) using the stored weights (or deterministic fallback weights if none are trained). Produces 4 output logits, applies a temperature-scaled softmax to return probabilities, predicted class, and confidence. Calculates per-sample cross-entropy loss and batch accuracy using trueClass (when provided) and responds with the prediction results as JSON. Setup Activate the workflow and copy the production webhook URLs for POST /train and POST /predict. Send training data to /train (or rely on the default dataset) to initialize and persist weights in workflow static data. Send inference requests to /predict as JSON containing x: [8 numbers] (optionally add sampleId and trueClass: 1..4) and review the JSON response for probabilities, predictions, loss, and accuracy. An n8n automation workflow template by Alex Raj.
Alex Raj
web
free
Others in the same category, ranked by how often they are opened.