合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

        COMP 627代寫、代做Python設(shè)計(jì)程序
        COMP 627代寫、代做Python設(shè)計(jì)程序

        時(shí)間:2024-08-25  來源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯(cuò)



        COMP 627 – Assignment 1 
         
        Note: Refer to Eq. 2.11 in the textbook for weight update. Both weights, w1 and b, need to be adjusted. 
        According to Eq. 2.11, for input x1, error E = t-y and learning rate β: 
        w1_new=w1_old+ β E x1; 
        bnew= bold+ β E 
        COMP 627 Neural Networks and Applications 
        Assignment 1 
        Perceptron and Linear neuron: Manual training and real-life case 
        studies 
         
        Part 1: Perceptron 
        [08 marks] 
         
         
         Download Fish_data.csv file from LEARN page. Use this dataset to answer the two questions (i) and (ii) 
        below on Perceptron. The dataset consists of 3 columns. The first two columns are inputs (ring 
        diameter of scales of fish grown in sea water and fresh water, respectively). The third column is the 
        output which states whether the category of the fish is Canadian or Alaskan (the value is 0 for Canadian 
        and 1 for Alaskan). Perceptron model classifies fish into Canadian or Alaskan depending on these two 
        measures of ring diameter of scales. 
        (i) Extract the first AND last row of data and label these rows 1 and 2. Use an initial weight 
        vector of [w1= 102, w2= -28, b= 5.0] and learning rate β of 0.5 for training a perceptron 
        model manually as below: 
        Adjust the weights in example-by-example mode of learning using the two input vectors. 
        Present the input data in the order of rows 1 and 2 to the perceptron. After presentation 
        of each input vector and corresponding weight adjustment, show the resulting 
        classification boundary on the two data points as in Fig. 2.15 in the book. For each round 
        of weight adjustment, there will be a new classification boundary line. You can do the 
        plots on Excel, by hand, python or any other plotting software. Repeat this for 2 epochs 
        (i.e., pass the two input vectors twice through the perceptron). 
        (4 marks) 
         
         
        (ii) Write python code to create a perceptron model to use the whole dataset in fish.csv to 
        classify fish into Canadian or Alaskan depending on the two input measures of ring 
        diameter of scales. Use 200 epochs for accurate models. 
         
        Modify your python code to show the final classification boundary on the data. 
         
        Write the equation of this boundary line. 
        Compare with the classification boundary in the book. 
        (4 marks) 2 
        COMP 627 – Assignment 1 
         
        Note: For adjusting weights, follow the batch learning example for linear neuron on page 57 of the 
        textbook that follows Eq. 2.36. After each epoch, adjust the weights as follows: 
         
         w1_new=w1_old + β (E1 x1 + E2 x2)/2 
        bnew= bold + β (E1 + E2)/2 
        where E1 and E2 are the errors for the two inputs. 
         
         
         
        Part 2: Single Linear Neuron 
         
        [12 marks] 
        Download heat_influx_north_south.csv file from LEARN page. Use this dataset to develop a single 
        linear neuron model to answer the questions (i) to (v) below. This is the dataset that we learned about 
        in the text book and lectures where a linear neuron model had been trained to predict heat influx in 
        to a house from the north and south elevations of the house. Note that the dataset has been 
        normalised (between 0 and 1) to increase the accuracy of the models. When data (inputs and outputs) 
        have very different ranges, normalisation helps balance this issue. 
        (i) Use two rows of data (rows 1 and 2 (0.319, 0.929) and (0.302, 0.49)), respectively, to train 
        a linear neuron manually to predict heat influx into a home based on the north elevation 
        (angle of exposure to the sun) of the home (value in ‘North’ column is the input for the 
        single neuron where output is the value in ‘HeatFlux’ column). Use an initial weight vector 
        of [b (bias) = 2.1, w1= -0.2] and learning rate of 0.5. Bias input =1. You need to adjust 
        both weights, b and w1. 
        (3 marks) 
         
        a) Train the linear neuron manually in batch mode. Repeat this for 2 epochs. 
         
        Note: 
        Try to separate the dataset into two datasets based on the value in ‘Canadian_0_Alaskan_1’ column. 
        Example code is given below. 
        #create dataframe X1 with input columns of the rows with the value 0 in 'Canadian_0_Alaskan_1' column 
        X1 = df.loc[df["Canadian_0_Alaskan_1"] == 0].iloc[:, 0:2] 
         
         
        Plot the data of two datasets with different markers ‘o’ and ‘x’. 
        Plot the decision boundary line using the equation used in Laboratory Tutorial 2 – Part 2 (Please note 
        that there is a correction in the equation and the updated assignment is available on LEARN). 
        Final plot should be like this. 3 
        COMP 627 – Assignment 1 
         
        1 2 
        Note: To retrieve the mean squared error, you can use the following code 
         
        from sklearn.metrics import mean_squared_error 
        print(mean_squared_error(Y, predicted_y)) 
        b) After the training with the 2 epochs is over, use your final weights to test how the 
        neuron is now performing by passing the same two data points again into the neuron 
        and computing error for each input (E1 and E2). Compute Mean Square Error (MSE) 
        for the 2 inputs using the formula below. 
         
           
        2+   
        2
         
        MSE = 

         
        (ii) Write a python program to train a single linear neuron model using all data to predict heat 
        influx from north elevation (value in ‘North’ column is the input for the single neuron 
        where output is the value in ‘HeatFlux’ column) using all data. Train the model with 3000 
        epochs for high accuracy. 
         
        Extract the weights of the model and write the equation for the neuron function (linear 
        equation showing input-output relationship as in Eq. 2.44) and plot the neuron function 
        on data as in Figure 2.34 in the textbook. 
         
        Modify the code to retrieve the mean square error (MSE) and R
        2
         score for the trained 
        neuron model. 
        (3 marks) 
         
         
        (iii) Write a python program to train a linear neuron on the whole data set to predict heat 
        influx from north and south elevations (using the two inputs from the two columns 
        ‘South’ and ‘North’). Train the model with 3000 epochs for high accuracy. 
         
        Extract the weights of the model and write the equation for the network function. 
         
        Modify your program to find the Mean Square Error (MSE) and R
        2
         score of the model. 
         
        Compare the error difference between the previous one-input case (in part (ii)) and the 
        current two-input case. 
        (4 marks) 
         
        (iv) Modify the program to plot the data and the network function on the same plot (Refer to 
        the Laboratory Tutorial 4). Plot the network function on the data (3D plot of predicted 
        heat influx as a function plotted against north and south elevations.(1 marks) 
        Note: Neural Network develops a function (plane/surface) that goes through the data as closely as 
        possible. Here, we want to see how close this surface is to the data. Since we have 2 inputs, we need a 
        3-D plot to see this. We plot the network function against the two inputs. 
        Your final output should look like this: 4 
        COMP 627 – Assignment 1 
         
        Note: In the plot in part (iv) above, the network function was shown as a surface plotted against the 2 
        inputs. However, you can also calculate the NN predicted heat influx for those exact input values for north 
        and south elevations in the dataset (as opposed to showing the function) and then plot the predicted heat 
        influx and target heat influx on the same 3D plot against the 2 inputs. 
        Your final output should look like this: 
        (v) Plot the network predicted heat influx values and target heat influx values against the two 
        inputs (3D data plot). 
        (1 marks) 

        請(qǐng)加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp

        掃一掃在手機(jī)打開當(dāng)前頁
      1. 上一篇:代做COMP5216、代寫Java設(shè)計(jì)編程
      2. 下一篇:代做QBUS3330、c++,Python編程設(shè)計(jì)代寫
      3. 無相關(guān)信息
        合肥生活資訊

        合肥圖文信息
        出評(píng) 開團(tuán)工具
        出評(píng) 開團(tuán)工具
        挖掘機(jī)濾芯提升發(fā)動(dòng)機(jī)性能
        挖掘機(jī)濾芯提升發(fā)動(dòng)機(jī)性能
        戴納斯帝壁掛爐全國售后服務(wù)電話24小時(shí)官網(wǎng)400(全國服務(wù)熱線)
        戴納斯帝壁掛爐全國售后服務(wù)電話24小時(shí)官網(wǎng)
        菲斯曼壁掛爐全國統(tǒng)一400售后維修服務(wù)電話24小時(shí)服務(wù)熱線
        菲斯曼壁掛爐全國統(tǒng)一400售后維修服務(wù)電話2
        美的熱水器售后服務(wù)技術(shù)咨詢電話全國24小時(shí)客服熱線
        美的熱水器售后服務(wù)技術(shù)咨詢電話全國24小時(shí)
        海信羅馬假日洗衣機(jī)亮相AWE  復(fù)古美學(xué)與現(xiàn)代科技完美結(jié)合
        海信羅馬假日洗衣機(jī)亮相AWE 復(fù)古美學(xué)與現(xiàn)代
        合肥機(jī)場(chǎng)巴士4號(hào)線
        合肥機(jī)場(chǎng)巴士4號(hào)線
        合肥機(jī)場(chǎng)巴士3號(hào)線
        合肥機(jī)場(chǎng)巴士3號(hào)線
      4. 上海廠房出租 短信驗(yàn)證碼 酒店vi設(shè)計(jì)

        主站蜘蛛池模板: 3d动漫精品啪啪一区二区中文 | 亚洲国产专区一区| 日韩精品人妻av一区二区三区| 久久亚洲色一区二区三区| 无码少妇丰满熟妇一区二区| 99精品高清视频一区二区| 一区二区免费视频| 东京热无码av一区二区| 四虎永久在线精品免费一区二区| 国产乱码一区二区三区| 中文字幕亚洲综合精品一区| 亚洲日本一区二区一本一道| 国产成人一区二区三区精品久久| 无码人妻一区二区三区在线视频| 久久无码一区二区三区少妇 | 亚洲av色香蕉一区二区三区| 亚洲日韩精品一区二区三区无码| 秋霞鲁丝片一区二区三区| 无码福利一区二区三区| 亚洲av日韩综合一区在线观看| 国产激情一区二区三区| 亚洲AV无码一区二区三区在线观看| 国产精品成人99一区无码| 精品国产一区二区三区久久狼| 无码中文字幕人妻在线一区二区三区| 日韩一区二区三区无码影院| 亚洲爆乳精品无码一区二区三区| 亚洲色婷婷一区二区三区| 末成年女A∨片一区二区| 亚洲av成人一区二区三区| 亚洲欧美日韩一区二区三区 | 国产精品免费视频一区| 国产乱码精品一区二区三区香蕉| 亚洲熟女乱色一区二区三区| 欧美激情国产精品视频一区二区 | 国产日韩一区二区三区在线播放| 亚洲午夜精品一区二区公牛电影院| 精品无码国产一区二区三区AV| 亚洲一区无码中文字幕乱码| 亚洲综合激情五月色一区| 国产伦精品一区三区视频|