Sie sind auf Seite 1von 3

Lab I

In this lab, you will learn a few basic functionalities of Matlab Neural Network Toolbox. Firstly, you will use a few coding lines to create a single neuron. Secondly, you will use an automatic fitting functionality of the NN Toolbox to solve a more difficult problem. Lab reports are due on Wednesday, July 24.

Conceptualizing
1. 2. Draw a neural with two inputs and one output. Calculate the net inputs of the neuron if: a. W = [1 2], b=0 i. p1 = 2, p2 = 1 ii. p1 = 2, p2 = 3 iii. p1 = 6, p2 = 1 iv. p1 = 2, p2 = 3 b. W = [2 3], b=2 i. p1 = 2, p2 = 3 ii. p1 = -1, p2 = 2 iii. p1 = -2, p2 = -3

Build Your First Neural


You will be using Matlab to build your first neuron. I have introduced Matlab syntax along the way. 1. Initialize the Neural Network:

net = linearlayer; net.inputs{1}.size = 2; net.layers{1}.dimensions = 1; 2. Set the weight to be [1 2] and bias to be 0:

net.IW{1,1} = [1 2]; net.b{1} = 0; 3. Define inputs p1 = 2, p2 = 3:

P = [2; 3]; 4. Now simulate the network and calculate outputs.

A = net(P) Now change W and b to, W = [2 3] and b = 2. Use inputs p1 = -2, p2 = -3 to calculate new output. 6. Change W back to W = [1 2]. 7. Change input vector to P = [1 2;2 1] and calculate the output. 8. How has the output changed from the previous calculation? 9. Set P = [1 2 2 3; 2 1 3 1] and calculate output. 10. What do the rows and columns of P represent? 11. What is the difference between P in 9. and P = [1; 2; 2; 3; 2; 1; 3; 1]? Would this input work for this neural? 12. If you have an appropriate neural and inputs, P = [1; 2; 2; 3; 2; 1; 3; 1], how would the output be different from 9.? 5.

Predicting Prices of Houses


Function fitting is the process of training a neural network on a set of inputs in order to produce an associated set of target outputs. Once the neural network has fit the data, it forms a generalization of the input-output relationship and can be used to generate outputs for inputs it was not trained on. This dataset can be used to train a neural network to estimate the median house price in a neighborhood based on neighborhood statistics. You will use this dataset to learn a automated functionality of Matlab NN toolbox. Here are some of the attributes of the provided dataset: houseInputs - a 13x506 matrix defining thirteen attributes of 506 different neighborhoods. These attributes consist of the following: 1. Per capita crime rate per town 2. Proportion of residential land zoned for lots over 25,000 sq. ft. 3. Proportion of non-retail business acres per town 4. 1 if tract bounds Charles river, 0 otherwise 5. Nitric oxides concentration (parts per 10 million) 6. Average number of rooms per dwelling 7. Proportion of owner-occupied units built prior to 1940 8. Weighted distances to five Boston employment centres 9. Index of accessibility to radial highways 10. Full-value property-tax rate per $10,000 11. Pupil-teacher ratio by town 12. 1000(Bk - 0.63)^2, where Bk is the proportion of blacks by town

13. Percent lower status of the population houseTargets - a 1x506 matrix of median values of owner-occupied homes in each neighborhood in 1000's of dollars. (This data is available from the UCI Machine Learning Repository http://mlearn.ics.uci.edu/MLRepository.html) 1. 2. 3. 4. 5. 6. 7. 8. Start the Matlab fitting tool by using the command nftool; Go through the prompts and give the included files as input and output, accordingly. Once data is imported, go through prompts and set each of the validation and test sets to 15% of the total sample. Describe the roles of the validation set and test set of a neural network. Work through the prompts and set the number of hidden layers to 10. Train the system. Work through the prompts and plot the performance of the network. Describe this plot. Work through the prompts and generate the simple script.

Das könnte Ihnen auch gefallen