国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看

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

代寫(xiě)FIT3181: Deep Neural Networks
代寫(xiě)FIT3181: Deep Neural Networks

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


FIT3181: Deep Learning (2024)

Deep Neural Networks

Due: 11:55pm Sunday, 8 September 2024 (Sunday)

Important note: This is an individual assignment. It contributes 25% to your final mark. Read the assignment instructions carefully.

What to submit

This assignment is to be completed individually and submitted to Moodle unit site. By the due date, you are required to submit one single zip file, named  xxx_assignment01_solution.zip where  xxx is your student ID, to the corresponding Assignment (Dropbox) in Moodle. You can use Google Colab to do Assigmnent 1 but you need to save it to an   *.ipynb file to submit to the unit Moodle.

More importantly, if you use Google Colab to do this assignment, you need to first make a copy of this notebook on your Google drive .

For example, if your student ID is 12356, then gather all of your assignment solution to folder, create a zip file named 123456_assignment01_solution.zip and submit this file.

Within this zipfolder, you must submit the following files:

1. Assignment01_solution.ipynb: this is your Python notebook solution source file.

2. Assignment01_output.html: this is the output of your Python notebook solution exported in html format.

3. Any extra files or folder needed to complete your assignment (e.g., images used in your answers).

Since the notebook is quite big to load and work together, one recommended option is to split solution into three parts and work on them seperately. In that case, replace Assignment01_solution.ipynb by three notebooks: Assignment01_Part1_solution.ipynbAssignment01_Part2_solution.ipynb and Assignment01_Part3_solution.ipynb

You can run your codes on Google Colab. In this case, you have to make a copy of your Google colab notebook including the traces and progresses of model training before submitting.

Part 1: Theory and Knowledge Questions    [Total marks for this part: 30 points]

The first part of this assignment is to demonstrate your knowledge in deep learning that you have acquired from the lectures and tutorials materials. Most of the contents in this assignment are drawn from the lectures and tutorials from weeks 1 to 4. Going through these materials before attempting this part is highly   recommended.

Question 1.1 Activation function plays an important role in modern Deep NNs. For each of the activation functions below, state its output range, find its derivative (show your steps), and plot the activation fuction and its derivative

(b) Gaussian Error Linear Unit (GELU): GELU(x) = xΦ(x) where Φ(x) is the  probability cummulative function of the standard Gaussian distribution or  Φ(x) = P (X ≤ x) where X ~ N (0, 1) . In addition, the GELU activation fuction (the link for the main paper (https://arxiv.org/pdf/1606.08415v5.pdf)) has

been widely used in the state-of-the-art Vision for Transformers (e.g., here is the link for the main ViT paper (https://arxiv.org/pdf/2010.11929v2.pdf)).  [1.5 points]

Write your answer here. You can add more cells if needed.

Question 1.2: Assume that we feed a data point with a ground-truth label y = 2 to the feed-forward neural network with the  ReLU activation function as shown in the following figure 

(a) What is the numerical value of the latent presentation h1 (x)?  [1 point]

(b) What is the numerical value of the latent presentation h2 (x)?   [1 point]

(c) What is the numerical value of the logith3 (x)?   [1 point]

(d) What is the corresonding prediction probabilities p(x)?   [1 point]

(e) What is the predicted label y(^)? Is it a correct and an incorect prediction? Remind that y = 2. [1 point]

(f) What is the cross-entropy loss caused by the feed-forward neural network at (x, y)? Remind that y = 2.  [1 point]

(g) Why is the cross-entropy loss caused by the feed-forward neural network at (x, y) (i.e., CE(1y, p(x))) always non-negative? When does this CE(1y, p(x)) loss get the value 0? Note that you need to answer this question for a general pair (x, y) and a general feed-forward neural network with, for example M = 4  classes?   [1 point]

You must show both formulas and numerical results for earning full mark. Although it is optional, it is great if you show your PyTorch code for your computation.

Question 1.3:

For Question 1.3, you have two options:

·   (1) perform the forwardbackward propagationand SGD update for  one mini-batch (10 points), or

·   (2) manually implement a feed-forward neural network that can work on real tabular datasets (20 points).

You can choose either (1) or (2) to proceed.

Option 1         [Total marks for this option: 10 points]

Assume that we are constructing a multilayered feed-forward neural network for a classification problem with three classes where the model parameters will be generated randomly using your student IDThe architecture of this network is 3(Input) → 5(ELU) → 3(output) as shown in the following figure. Note that the ELU has the same formula as the one in Q1.1.

We feed a batch X with the labels Y as shown in the figure. Answer the following questions. 

You need to show both formulas, numerical results, and your PyTorch code for your computation for earning full marks.

In  [  ]:

Out[3]:

<torch._C.Generator at 0x7dc439f98810>

In  [  ]:

#Code to generate random matrices and biases for W1, b1, W2, b2

Forward propagation

(a) What is the value of h(¯)1 (x) (the pre-activation values of h1 )?  [0.5 point]

In  [  ]:

(b) What is the value of h1 (x)?   [0.5 point]

In  [  ]:

(c) What is the predicted value y(^)?  [0.5 point]

In  [  ]:

(d) Suppose that we use the cross-entropy (CE) loss. What is the value of the CE loss l incurred by the mini-batch? [0.5 point]

In  [  ]:

Backward propagation

(e) What are the derivatives   ,  , and ?  [3 points]

In  [  ]:

(f) What are the derivatives  ,  ,  , and  ?   [3 points]

In  [  ]:

SGD update

(g) Assume that we use SGD with learning rate η = 0.01 to update the model parameters. What are the values of W 2 , b2 and W 1 , b1  after updating?  [2 points]

In  [  ]:

Option 2    [Total marks for this option: 20 points]

In  [  ]:

import torch

from torch.utils.data import DataLoader

from torchvision import datasets, transforms

In Option 2, you need to implement a feed-forward NN manually using PyTorch and auto-differentiation of PyTorch. We then manually train the model on the MNIST dataset.

We first download the  MNIST dataset and preprocess it.

In  [  ]:

Each data point has dimension   [28,28] . We need to flatten it to a vector to input to our FFN.

In  [  ]:

train_dataset.data = train_data.data.view(-1, 28*28)  test_dataset.data = test_data.data.view(-1, 28*28)

train_data, train_labels = train_dataset.data, train_dataset.targets  test_data, test_labels = test_dataset.data, test_dataset.targets

print(train_data.shape, train_labels.shape)

print(test_data.shape, test_labels.shape)

In  [  ]:

train_loader = DataLoader(dataset=train_dataset, batch_size=64, shuffle=True)  test_loader = DataLoader(dataset=test_dataset, batch_size=64, shuffle=False)

Develop the feed-forward neural networks

(a) You need to develop the class  MyLinear with the following skeleton. You need to declare the weight matrix and bias of this linear layer.  [3 points]

In  [  ]:

(b) You need to develop the class  MyFFN with the following skeleton   [7 points]

In  [  ]:

In  [  ]:

myFFN = MyFFN(input_size = 28*28, num_classes = 10, hidden_sizes = [100, 100], act = torch.nn.ReLU)  myFFN.create_FFN()

print(myFFN)

(c) Write the code to evaluate the accuracy of the current  myFFN model on a data loader (e.g., train_loader or test_loader).   [2.5 points]

In  [  ]:

(c) Write the code to evaluate the loss of the current  myFFN model on a data loader (e.g., train_loader or test_loader).  [2.5 points]

In  [  ]:

def compute_loss(model, data_loader):

"""

This function computes the loss of the model on a data loader

"""

#Your code here

Train on the  MNIST data with 50 epochs using  updateSGD .

In  [  ]:

(d) Implement the function  updateSGDMomentum in the class and train the model with this optimizer in   50 epochs. You can update the corresponding function in the  MyFNN class.   [2.5 points]

In  [  ]:

(e) Implement the function  updateAdagrad in the class and train the model with this optimizer in   50 epochs. You can update the corresponding function in the MyFNN class.  [2.5 points]

In  [  ]:

Part 2: Deep Neural Networks (DNN)   [Total marks for this part: 25 points]

The second part of this assignment is to demonstrate your basis knowledge in deep learning that you have acquired from the lectures and tutorials materials. Most of the contents in this assignment are drawn from the tutorials covered from weeks 1 to 2. Going through these materials before attempting this assignment is highly recommended.

In the second part of this assignment, you are going to work with the FashionMNIST dataset for image recognition task. It has the exact same format as MNIST (70,000 grayscale images of 28 × 28 pixels each with 10 classes), but the images represent fashion items rather than handwritten digits, so each class is more  diverse, and the problem is significantly more challenging than MNIST.

In  [  ]:

import torch

from torch.utils.data import DataLoader

from torchvision import datasets, transforms torch.manual_seed(1234)

Load the Fashion MNIST using   torchvision

In  [  ]:

torch.Size([60000, 28, 28]) torch.Size([60000]) torch.Size([10000, 28, 28]) torch.Size([10000]) torch.Size([60000, 784]) torch.Size([60000])

torch.Size([10000, 784]) torch.Size([10000])

Number of training samples: 18827  Number of training samples: 16944  Number of validation samples: 1883

Question 2.1: Write the code to visualize a mini-batch in  train_loader including its images and labels.  [5 points]

In  [  ]:

####Question 2.2: Write the code for the feed-forward neural net using PyTorch   [5 points]

We now develop a feed-forward neural network with the architecture 784 → 40(ReLU) → 30(ReLU) → 10(softmax) . You can choose your own way to implement your network and an optimizer of interest. You should train model in 50 epochs and evaluate the trained model on the test set.

In  [  ]:

Question 2.3: Tuning hyper-parameters with grid search   [5 points]

Assume that you need to tune the number of neurons on the first and second hidden layers n1   ∈ {20, 40} , n2  ∈ {20, 40} and the used activation function act ∈ {sigmoid, tanh, relu} . The network has the architecture pattern 784 → n1 (act) → n2 (act) → 10(softmax) where n1 , n2 , and act are in their

grides. Write the code to tune the hyper-parameters n1 , n2 , and act. Note that you can freely choose the optimizer and learning rate of interest for this task.

In  [  ]:

 

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




 

掃一掃在手機(jī)打開(kāi)當(dāng)前頁(yè)
  • 上一篇:COMP20003代寫(xiě)、代做c/c++,Java語(yǔ)言編程
  • 下一篇:代寫(xiě)ECON1011 Economics for Business
  • 無(wú)相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢(qián)_專業(yè)CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢(qián)_專業(yè)CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路流場(chǎng)仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真技術(shù)服務(wù)
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強(qiáng)度疲勞振動(dòng)
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強(qiáng)度疲
    流體cfd仿真分析服務(wù) 7類(lèi)仿真分析代做服務(wù)40個(gè)行業(yè)
    流體cfd仿真分析服務(wù) 7類(lèi)仿真分析代做服務(wù)4
    超全面的拼多多電商運(yùn)營(yíng)技巧,多多開(kāi)團(tuán)助手,多多出評(píng)軟件徽y1698861
    超全面的拼多多電商運(yùn)營(yíng)技巧,多多開(kāi)團(tuán)助手
    CAE有限元仿真分析團(tuán)隊(duì),2026仿真代做咨詢服務(wù)平臺(tái)
    CAE有限元仿真分析團(tuán)隊(duì),2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內(nèi)
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗(yàn)證碼 豆包網(wǎng)頁(yè)版入口 破天一劍 目錄網(wǎng) 排行網(wǎng)

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號(hào)-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    成人免费视频a| 国产精品成人品| 色综合久久av| 久99久在线| 欧美视频小说| 欧美成aaa人片免费看| 国产精品亚洲аv天堂网| 午夜精品久久久久久久久久久久| 国产激情片在线观看| 日韩中文不卡| 国产精品视频福利| 国产精品主播视频| 亚洲bt天天射| 精品国产欧美一区二区三区成人| 国产肉体ⅹxxx137大胆| 亚洲一区二区三区毛片| 国产成人亚洲综合青青| 国内自拍欧美激情| 亚洲色婷婷久久精品av蜜桃| 久久久久久久亚洲精品| 国产一区二区色| 少妇久久久久久被弄到高潮 | 日本一区二区三区视频免费看| 日韩亚洲国产中文字幕| 国产亚洲综合视频| 天天夜碰日日摸日日澡性色av| 久久久91精品| 99在线观看| 日韩欧美精品免费| 九九精品在线视频| 久久观看最新视频| 国产免费一区二区三区香蕉精| 日本一区二区三区www| 久久这里有精品视频| 国产福利视频在线播放| 黄色激情在线视频| 日韩中字在线观看| 色综合久久悠悠| xvideos亚洲| 91国偷自产一区二区三区的观看方式| 欧美区高清在线| 亚洲爆乳无码专区| 欧美成人在线影院| 久久精品国产综合精品| 国产精品一香蕉国产线看观看| 热门国产精品亚洲第一区在线 | www.日本久久久久com.| 99久久激情视频| 麻豆蜜桃91| 日本一区二区三区四区在线观看| 色综合久久88| 国产精品美女黄网| 色偷偷9999www| 久久久午夜视频| 国产精品亚洲二区在线观看| 免费看欧美黑人毛片| 日本高清不卡一区二区三| 亚洲最大av网| 精品乱子伦一区二区三区| 国产精品无码专区在线观看| 国产激情999| 81精品国产乱码久久久久久| 国产日韩精品电影| 激情综合网婷婷| 日韩免费高清在线观看| 日韩一区二区三区资源| 这里只有精品66| 久久99久久99精品免观看粉嫩 | 国产高清精品软男同| 成人av色在线观看| 国产亚洲情侣一区二区无| 欧洲中文字幕国产精品| 日韩成人手机在线| 性亚洲最疯狂xxxx高清| 一区二区三区av| 国产99视频精品免费视频36| 国产精品免费小视频| 日日骚久久av| 久久久久久午夜| 久久精品在线免费视频| 91国产丝袜在线放| 91看片淫黄大片91| 99国产视频| 97久久精品人搡人人玩| 97久久国产亚洲精品超碰热| 分分操这里只有精品| 国产精品永久免费视频| 国产精品中文字幕在线观看| 国产欧美va欧美va香蕉在线| 国产一区在线免费观看| 国产在线视频2019最新视频| 今天免费高清在线观看国语| 欧美二区在线| 麻豆精品蜜桃一区二区三区| 国产一区二区免费电影| 国产三级中文字幕| 国产精品一码二码三码在线| 成人免费在线网| 91精品黄色| 国产高清精品在线观看| 日韩在线视频播放| 国产精品日韩欧美大师| 久久亚洲精品网站| 中文字幕精品—区二区日日骚| 亚洲最大的av网站| 日韩中文字幕组| 日韩精品国内| 麻豆av一区二区三区| 国产三区二区一区久久| www..com日韩| 国产成人精品电影| 国产成人精品视频在线观看| 国产精品-区区久久久狼| 欧美伦理91i| 一区二区三区av| 三级网在线观看| 欧美日韩电影一区二区| 国产区精品在线观看| 91高清视频免费| 精品国产区一区二区三区在线观看 | 欧美精品久久| 国产一区二区在线播放| 97欧洲一区二区精品免费| 国产a级全部精品| 国产精品久久久久久av福利| 伊人久久大香线蕉成人综合网| 欧美一区二区激情| 欧美 国产 综合| av动漫在线播放| 日韩在线免费视频观看| 精品国产一区三区| 岛国视频一区免费观看| 欧美极品色图| 99国产精品久久久久老师| 久久狠狠久久综合桃花| 久久亚洲综合国产精品99麻豆精品福利 | 久久精品xxx| 国产精品久久久久久久久| 亚洲欧美日韩在线综合| 欧美亚洲成人免费| 国产青春久久久国产毛片| 国产夫妻自拍一区| 欧美精品一区二区三区国产精品 | 亚洲 欧洲 日韩| 狠狠色伊人亚洲综合网站色| 成人免费91在线看| 久久精品国产91精品亚洲| 亚洲欧美日韩在线综合| 免费观看亚洲视频| 国产成人精品免费视频| 欧美日韩成人在线观看| 日本国产一区二区三区| 国产伦精品一区二区三区照片91| 国产ts人妖一区二区三区| 欧美激情精品在线| 欧美亚洲一二三区| 国产精品旅馆在线| 久久精品2019中文字幕| 久久6免费高清热精品| 婷婷久久青草热一区二区| 三年中文高清在线观看第6集| 欧美日产一区二区三区在线观看| 国产日产欧美精品| 欧美精品videofree1080p| 欧美精品在线观看| 欧美久久久久久| 国产成人亚洲综合青青| 中文精品视频一区二区在线观看 | 久久99视频精品| 欧美深夜福利视频| 久久资源亚洲| 精品成在人线av无码免费看| 欧美一区二区中文字幕| 91精品国产91久久久久久最新| 精品国产第一页| 美女亚洲精品| 久久精品国产精品亚洲| 日韩av综合在线观看| 91精品黄色| 一卡二卡三卡视频| 国产一二三四区在线观看| 国产精品视频yy9099| 欧美在线日韩在线| 国产v综合ⅴ日韩v欧美大片| 亚洲av综合色区| 91免费看国产| 欧美激情一区二区三区在线视频观看 | 精品国产一二| 国模私拍视频一区| 国产精品免费一区二区三区 | 精品婷婷色一区二区三区蜜桃| 久久黄色av网站| 欧美亚洲另类制服自拍| 久久久久久久久久久视频| 日本午夜精品一区二区| 久久久免费在线观看| 亚洲国产精品女人| 97久久久久久| 午夜一区二区三区| 91精品久久久久久久|