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

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

代寫FIT3181: Deep Neural Networks
代寫FIT3181: Deep Neural Networks

時間:2024-09-03  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯


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  [  ]:

 

請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp




 

掃一掃在手機打開當前頁
  • 上一篇:COMP20003代寫、代做c/c++,Java語言編程
  • 下一篇:代寫ECON1011 Economics for Business
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢_專業CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務 管路流場仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務 管路
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真技術服務
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲勞振動
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲
    流體cfd仿真分析服務 7類仿真分析代做服務40個行業
    流體cfd仿真分析服務 7類仿真分析代做服務4
    超全面的拼多多電商運營技巧,多多開團助手,多多出評軟件徽y1698861
    超全面的拼多多電商運營技巧,多多開團助手
    CAE有限元仿真分析團隊,2026仿真代做咨詢服務平臺
    CAE有限元仿真分析團隊,2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗證碼 寵物飼養 十大衛浴品牌排行 suno 豆包網頁版入口 wps 目錄網 排行網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    精品日韩美女| 国产欧美一区二区三区久久人妖| 日韩精品电影网站| 99精品在线免费视频| 久久国产精品电影| 黄色一级大片免费| 久久久久久午夜| 日韩中文字幕在线不卡| www婷婷av久久久影片| 中文字幕人妻熟女人妻洋洋| 国产尤物91| 日韩中文字幕免费| 欧在线一二三四区| 日韩在线激情视频| 日韩精品 欧美| www.欧美免费| 欧美激情专区| 国产精品视频网址| 今天免费高清在线观看国语| 久久久精品电影| 欧美大陆一区二区| 国产精品成熟老女人| 国产一区二区三区黄| 精品久久久久久亚洲| 国产日韩在线观看av| 欧美成人全部免费| 精品一区二区久久久久久久网站| 国产精品区一区| 狠狠色狠狠色综合人人| 国产精品视频免费在线观看| 欧美精品一区二区三区在线四季| 久久久精品久久久| 国内揄拍国内精品| 久久6精品影院| 国产精品小说在线| 亚洲国产精品www| 国产传媒欧美日韩| 欧美无砖专区免费| 欧美成人精品在线播放| 国产精品一区二区三区成人| 亚洲色成人www永久在线观看| av动漫在线看| 日本天堂免费a| 国产精品三区www17con| 国产日韩在线免费| 亚洲a∨日韩av高清在线观看 | 欧美精品福利在线| 91麻豆国产语对白在线观看| 日韩精品久久久免费观看| 国产精品久久久影院| 福利视频久久| 日韩欧美在线电影| 国产精品久久久久aaaa九色| 国产精品主播视频| 亚洲精品在线观看免费| 日日摸夜夜添一区| 国产一区二区高清不卡| 亚洲精品高清国产一线久久| www.欧美精品一二三区| 蜜桃av久久久亚洲精品| 亚洲一区二区三区精品动漫| 久久精品国产99精品国产亚洲性色| 欧美精品久久| 一区二区三区av在线| 久久国产精品99久久久久久丝袜| 韩国精品久久久999| 亚洲欧洲精品一区二区| 久久激情视频久久| 97国产精品人人爽人人做| 日本一欧美一欧美一亚洲视频| 国产精品视频久久| www.av蜜桃| 欧美日韩高清免费| 中文一区一区三区免费| 日韩亚洲在线观看| 成人亚洲欧美一区二区三区| 欧美午夜视频在线| 亚洲国产精品久久久久婷婷老年| 国产精品女人网站| 久久久精彩视频| 国产日韩精品电影| 欧美亚洲在线播放| 午夜dv内射一区二区| 美女久久久久久久久久久| 国产不卡精品视男人的天堂| 国产精品一区二区三区免费观看| 欧美精品一区二区三区四区五区| 亚洲二区自拍| 欧美精品www| 久久夜色撩人精品| 久久久精品网站| 久久久亚洲天堂| 国产乱子伦精品无码专区| 欧美做暖暖视频| 日韩在线国产| 亚洲一区 在线播放| 久久成人精品电影| 国产成人精品一区二区三区福利| 91精品久久久久久久久青青| 国产日韩综合一区二区性色av| 青草青草久热精品视频在线网站| 亚洲欧美日韩国产成人综合一二三区| 国产精品免费视频一区二区| 久久精品国产精品亚洲色婷婷 | 日韩中文av在线| 国产黄页在线观看| 99se婷婷在线视频观看| 国产伦精品一区二区三区四区视频 | 国产成人精品免费视频大全最热| 国产欧美va欧美va香蕉在线| 黄色一级大片在线观看| 日韩欧美一区三区| 日本一区二区高清视频| 亚洲va男人天堂| 亚洲v日韩v欧美v综合| 一女被多男玩喷潮视频| 欧美激情伊人电影| 美女av一区二区三区| 久久av在线播放| 色综合久综合久久综合久鬼88| 不卡中文字幕av| 欧美精品免费在线观看| 国产精品久久久久久免费观看 | 欧美一级免费在线观看| 日韩一级片一区二区| 午夜免费在线观看精品视频| 亚洲精品成人自拍| 午夜精品一区二区三区在线视频 | 成人毛片一区二区| 高清一区二区三区日本久 | 日韩欧美视频网站| 人妻有码中文字幕| 日韩久久在线| 欧美 日韩 国产在线| 欧美激情精品久久久久久小说| 激情五月亚洲色图| 国产在线青青草| 国产免费一区| 97国产精品视频| 久久久人成影片一区二区三区 | 亚洲成人第一| 日本一区视频在线观看免费| 欧洲精品在线视频| 精品人妻大屁股白浆无码| 黄色一级二级三级| 国产精品亚洲激情| 久久免费视频这里只有精品| 色av吧综合网| 久久香蕉频线观| 亚洲一区二区三区四区在线播放| 亚洲 高清 成人 动漫| 日韩精品免费播放| 国内精品中文字幕| 国产伦精品免费视频| 911国产网站尤物在线观看| 国产成一区二区| 久久久久久欧美精品色一二三四| 欧美激情伊人电影| 国产99久久精品一区二区| 伊人久久大香线蕉午夜av| 色香蕉在线观看| 免费在线一区二区| 国产欧美综合一区| 国产成人精品日本亚洲| 国产精品免费看一区二区三区| 欧美日韩国产成人在线| 五月天婷亚洲天综合网鲁鲁鲁| 欧美主播一区二区三区美女 久久精品人 | 国产乱人伦真实精品视频| 68精品国产免费久久久久久婷婷| 日韩亚洲综合在线| 欧美精品久久久久a| 欧洲久久久久久| 阿v天堂2017| 久久久精品国产一区二区| 一区二区视频在线播放| 欧美影院久久久| 91精品国产综合久久香蕉最新版 | 日产精品久久久一区二区| 国内精品**久久毛片app| 成人中文字幕av| www.99久久热国产日韩欧美.com| 欧美激情18p| 欧美中在线观看| 99精品欧美一区二区三区| 国产精品久久不能| 日本一区二区高清视频| 国产精品自产拍在线观看中文| 精品国内亚洲在观看18黄| 五月天综合婷婷| 国产精品一区久久久| 国产精品视频永久免费播放| 午夜精品久久久99热福利| 国产免费毛卡片| 国产精品日韩一区| 色噜噜一区二区| 超碰在线观看97| 久久亚洲欧美日韩精品专区| 欧美中文字幕在线视频| 久久亚洲免费|