50% off: Unlimited data and AI learning.
State of Data and AI Literacy Report 2025

simpleMLP (version 1.0.0)

init_nn: Initialize network

Description

Initialize 3 layer fully connected neural network, also known as multilayer perceptron, setting biases to 0 and using the Xavier initialization method for weights.

Usage

init_nn(num_inputs, num_hidden_1, num_hidden_2, num_outputs)

Arguments

num_inputs

dimension of inputs

num_hidden_1

dimension of first hidden layer

num_hidden_2

dimension of second hidden layer

num_outputs

dimension of output

Value

list containing weight and bias matrices in each layer of the network

Examples

Run this code
# NOT RUN {
mlp_model <- init_nn(784, 100, 50, 10)
# }

Run the code above in your browser using DataLab