Visual editor quick start
The visual editor is a powerful way to create a neural network. In this guide we will explore the basics to get you up and running.
Introduction

Many neural networks are actually based on the same core building blocks and fundamental concepts. When programming a neural network, the developers do not need to code all the mathematics themselves - instead, neural network tools such as TensorFlow or PyTorch have built-in functions that do these repetitive tasks for you.
The visual editor takes this idea one step further. It allows you to create a neural network with a simple drag-and-drop interface. You can connect a variety of layers and mathematical operations together, and by getting creative you can create many different types of models.
Create a model
To create a model using the visual editor, go to the models page and click "Create". You will then be presented with a few options. For the "type", select "Visual editor". Give your model a name, an optional descripton, and click "Create". To start editing the model, click "Go to the visual editor" on the model page, under the "Configure" tab.
Nodes

By default, your model will have three nodes as shown in the image on the right. Let's start by describing what these do!
Starting from the left, the "Input" node defines the start of our model. By default, it has been configured the data type set to image. When the model is evaluated, the input image will be sent to all the nodes that the input node is connected to, which in this case is the "Resize image" node. The resize image node is a basic mathematical operation which outputs a scaled version of the input image. In this case, we can see that it has been configured to output an image of size 64x64 pixels. Finally, the scaled input is sent to the "Output" node, which defines the end of our model. The data sent to the output node will be sent back to whoever started the evaluation.
So this is just a model which takes an image of any size, and converts it to an image of size 64x64. Not really an AI just yet!
What is all these "(3, ?, ?)" and "Float32" text, for example on the input node? Well, the "Float32" means that our image actually is converted to a bunch of numbers, of type 32-bit floating point number. Floating point means that it is number with trailing decimals, as opposed to an integer. The "(3, ?, ?)" describes the "Shape" of the data sent by the input node. The first number, 3, means that the image has three channels, which the question marks means that the image can have any width and height. After the image has been resized, we see that it can no longer have any width and height - it is then exactly 64 pixels by 64 pixels large.
This model cannot be trained. A simple resize operation is a constant operation, which always does the same thing.
Perform an evaluation
So far we have a model which resizes an input image.
Before you can evaluate this model it must prepared for use, which is done by clicking the "compile model" button at the top of your screen. In the window that appears, you can leave all the settings as default and click "Compile". Once this is done, a new state is added in the states panel on the left. Click this new state to move to it, and click "Set as active" on the top panel. You model is now ready to be used.
What are these "states"? A model can have many states, one of which is active at any given time. Each state contains the entire graph configuration along with the values of all parameters (weights and biases) in the network. This means that because you can have many states, each model can have many different graph configurations. But still, only one of these will be ative at any given time. States are completely isolated from each other - when you make an edit in one state, all other states are unaffected. In the visual editor, a state can either be "compiled" or "editing". A state which is being edited cannot be used for evaluation and training. To train or evaluate your model, you need to make your edits in a "editing" state, and then click the "Compile model" button to create a compiled state. Similarly, a state which is "compiled" cannot be edited. We'll get back to what compiling actually does shortly.

To evaluate this model, go back to the model page, and under the "Deploy" tab, click "Perform evaluation". Now, upload an image, click evaluate, and you should soon get back a resized image.
Your browser sent the image to Decthings servers and the model was executed in the cloud. When the response was ready, it was sent back to your browser. Of course, you will not need to manually upload data in the future - an automated system can use the API to communicate with Decthings, to for example send an image to Decthings once per minute.
Adding machine learning - the simplest example
Okay, now we've seen how the visual editor takes input data and transforms it into output data. We've only seen one static mathematical operation, the "Resize image" node. Let's start actually doing some machine learning! We will start with something that is very simple but not very useful, to show how training and machine learning works. Then, we can use this knowledge to create something that actually can be used to create an AI for real-world applications.
Start by removing the three default nodes. To delete a node, click on it and then press the delete button on the right panel.

We will now add a "Parameter" node, which is the most basic node that can be trained. Right click anywhere on the background of the visual editor, and under "Input/Output", click "Parameter". This will add a "Parameter" node. A parameter node is very simple - it takes no inputs, and has one output. So what does it output? Well, the parameter node actually stores information, and it always outputs the information that it currently is storing. More specifically, it stores one or multiple numbers. By default, it contains a single 32-bit floating point number that is randomly selected.
Now create an "Output" node and connect the parameter to it. This allows you to see what value the parameter node contains, simply by evaluating the model. To evaluate it, compile the model, set the compiled state as the active state, go to the evaluations tab and perform an evaluation. Because we removed the input node, you will not need to provide an input image this time. When the evaluation is complete, you should see a single random number! When you compiled your model, a random number was selected and stored in the parameter node. This means that every time you evaluate this particular compiled state, you will get the same result.
Next, add an "Optimizer" node, which can be found under "Inputs/Outputs" in the right-click menu. Click the optimizer node and set the "Loss" to "Mean". You can leave all other settings as-is.
Connect the parameter node to both the output and the optimizer nodes. The output node is used when we evaluate the model, and the optimizer node is used when we train the model. So what does the optimizer node do exactly? Here is were we get into the fundamentals of machine learning. The optimizer node will look at the value provided to it - and minimize that value. In this case, because we have simply connected a parameter node to the optimizer, the value stored in our parameter will be minimized. That is, when training, the value stored in our parameter will get smaller and smaller. The value provided to the optimizer is often called the "loss function", or simply the "loss", of the model. In general, the loss defines how well the model is performing. This is why the optimizer will try to minimize the loss - if it can reduce the loss, the model is performing better.
Let's start training! Compile this model, set the compiled state as the active state, go back to the model page. First, perform an evaluation to see the value stored in the parameter. Then, go to the "Train" tab and click "Start training". When the training session is complete, a new state will be created which should then contain a parameter that has a smaller value. Fill the field "New state name" with anything you'd like, this is just used to keep different states appart. Scroll down and set the "Epochs" to something 100. The epochs parameter tells the model how long to train for. You can leave all other settings as their default values.

Click train, and the training session will soon begin. After a while, the model will report metrics which allow you to see how things are going. The graph "loss-optimizer-0" shows us hor the loss changes over time. The loss of a model is the value which is provided to the optimizer - in our case, this is just the parameter node. What we see in this graph is therefore the value stored in our parameter node. We can see it decrease over time, because our optimizer is successfully doing its job of decreasing the loss.
Once the training session is completed, a new state is added to the model. If you set this new state as the active state, and then perform an evaluation, the output value of the model has now changed. We have successfully trained our model!
Next steps
The things we've covered so far are the core concepts of machine learning - connecting data, computing a loss function and minimizing that loss function. You now have everything you need to actually build an AI!
To start building, I would recommend the guide Create an image classifier using the visual editor.