neurx v0.1.3 Neurx.Build View Source

Documentation for Build.

Link to this section Summary

Functions

Builds the network

Link to this section Functions

Builds the network.

How to use Build:

Example containing possible inputs

activation1 = fn(x) -> x * 2 end
activation2 = fn(x) -> x * x end
pre1 = fn(x) -> x * 4 end
pre2 = fn(x) -> x - 5 end
suf1 = fn(x) -> x + 1 end

nn = Neurx.build(%{
  input_layer: 3,
  output_layer: %{
    size: 2,
    activation: %{
      type: "Sigmoid"
    }
  },
  hidden_layers: [
    %{
      size: 5
    },
    %{
      size: 3,
      activation: %{
        type: "Sigmoid"
      }
    },
    %{
      size: 4,
      activation: %{
        func: activation1
      }
    }
    ,
    %{
      size: 7,
      activation: %{
        func: activation2
      },
      prefix_functions: [
        pre1,
        pre2
      ],
      suffix_functions: [
        suf1
      ]
    }
  ],
  loss_function: %{
    type: "MSE"
  },
  optim_function: %{
    type: "SGD",
    learning_rate: 0.3
  }
})