Figure 1.Single- and double-node NN results for classifying 100
6x1 vectors for the examples that only had a single 1 in the 6x1 vector (class=1)
or not (class=0).
Single and Double-Node Neural Network Lab
OBJECTIVE: Generate training set of 6x1 vectors that contain
1s and 0s. Classify which ones only contain a single 1 (class=1)
or not (class=0). Use a single node neural network and a double node neural network.
PROCEDURE:
- Load into your working directory Display.m,
Display2.m,
gradient.m,
gradient2.m,
TwoNode.m,
gradientnn.m,
NNode.m,
SingleNode_nonlinear.m.
- Type "TwoNode" while in MATLAB. Results
will be displayed for the predicted classes.
- Explain the differnces between the two-node
and single-node results.
-
Change the input to be a 3x1 vector, and change code
so it can run this. Rerun code. explain results compared to the
input with 6x1 vectors.
- Type NNode.m and compare the results to the single and double node results.
Change number of layers and comment on results.
-
Change code so activation functions are for likihood objective function and compare the result with L2 norm. Currently, code is for
L2 objective function. Liklihood gradient replaces
the gradient calculation at each layer dg=g(z)(1-g(z))
with a 1.
- Change activation function
from sigmoid to ReLu. ReLu(z) is 0 if z is
less than zero. ReLu(z)=z if z>0. The derivative
of ReLu is zero for z<0 and is equal
to 1 if z>0.
Compare ReLu results with the sigmoid results.