# construct a 2-4-3 network, plot result
nn <- mlp_net(c(2, 4, 3))
nn <- mlp_rnd_weights(nn)
mlp_plot(nn, TRUE)
# expand inputs, the new no. of inputs will be 5, with the first input
# becoming the 3rd and the second retaining its position, plot result
nn <- mlp_expand_reorder_inputs(nn, 5, c(3, 2))
mlp_plot(nn, TRUE)
# remove redundant neurons (i.e. 1, 4, 5) and plot result
nn <- mlp_rm_input_neurons(nn, TRUE)$net
mlp_plot(nn, TRUE)
Run the code above in your browser using DataLab