99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

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

代寫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
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    2025年10月份更新拼多多改銷助手小象助手多多出評軟件
    2025年10月份更新拼多多改銷助手小象助手多
    有限元分析 CAE仿真分析服務-企業/產品研發/客戶要求/設計優化
    有限元分析 CAE仿真分析服務-企業/產品研發
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
  • 短信驗證碼 trae 豆包網頁版入口 目錄網 排行網

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

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

    99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

          9000px;">

                性做久久久久久免费观看| 99re6这里只有精品视频在线观看 99re8在线精品视频免费播放 | 日韩视频不卡中文| 不卡一二三区首页| 成人av电影在线观看| 91视频在线观看免费| 99九九99九九九视频精品| 97久久超碰国产精品电影| 成人a免费在线看| 99国产精品久| 67194成人在线观看| 欧美日韩国产不卡| 亚洲精品一区二区三区香蕉| ww久久中文字幕| 亚洲女同一区二区| 久久成人久久爱| 99视频有精品| 欧美精品一区二区三区一线天视频| 欧美精品一区二区三区四区| 亚洲视频1区2区| 五月综合激情网| 成人av免费网站| 91超碰这里只有精品国产| 欧美激情在线观看视频免费| 亚洲午夜三级在线| 99视频在线观看一区三区| 欧美精品一区二区三区在线播放| 一区二区三国产精华液| 成人小视频免费在线观看| 精品国产1区二区| 蜜臀av一级做a爰片久久| 色一情一乱一乱一91av| 国产精品久久久久久久久免费桃花 | 国产精品一区二区你懂的| 制服丝袜av成人在线看| 亚洲欧美激情视频在线观看一区二区三区| 久久成人综合网| 欧美精品一区二区高清在线观看| 婷婷久久综合九色综合绿巨人 | 亚洲人妖av一区二区| 国产成人亚洲综合a∨婷婷 | 日韩**一区毛片| 日韩午夜中文字幕| 国产乱码精品一区二区三区忘忧草| 日韩欧美国产麻豆| 国产精品一区二区在线观看不卡| 久久综合久久综合久久综合| 国产精品99久久久久久久vr| 国产精品色呦呦| 日本韩国欧美一区| 日日噜噜夜夜狠狠视频欧美人| 7777精品伊人久久久大香线蕉经典版下载 | 日韩激情中文字幕| 久久午夜国产精品| 欧美视频一区二区三区四区| 老司机精品视频一区二区三区| 日韩限制级电影在线观看| 亚洲成av人**亚洲成av**| 欧美久久久久免费| 国产精品自产自拍| 日韩av电影免费观看高清完整版| 久久久久久久久久久久电影| 在线观看91视频| 成人开心网精品视频| 久久国产尿小便嘘嘘| 夜夜亚洲天天久久| 亚洲国产精品激情在线观看| 日韩午夜在线影院| 在线成人小视频| 99久久精品一区| 成人动漫视频在线| 国产精品综合二区| 久久狠狠亚洲综合| 日韩av电影天堂| 亚洲一区二区在线免费看| 国产亚洲va综合人人澡精品| 日韩一区二区在线播放| 在线成人小视频| 日韩一区二区在线看| 在线国产亚洲欧美| 91国模大尺度私拍在线视频| 成人精品国产免费网站| 成人高清免费观看| aaa亚洲精品| 91在线观看成人| 在线精品视频免费观看| 欧美系列一区二区| 日韩精品一区二区三区四区视频| 日韩欧美综合一区| 亚洲国产高清aⅴ视频| 中文字幕在线免费不卡| 一区二区三区不卡视频| 老色鬼精品视频在线观看播放| 国产一区二区按摩在线观看| 不卡的看片网站| 欧美在线色视频| 日韩午夜av电影| 亚洲欧洲精品一区二区精品久久久 | 欧美精选午夜久久久乱码6080| 欧美高清激情brazzers| 国产精品国产精品国产专区不蜜| 亚洲免费资源在线播放| 日本欧美大码aⅴ在线播放| 黄色精品一二区| 777色狠狠一区二区三区| 国产精品不卡在线| 国产一区视频网站| 日韩欧美国产午夜精品| 亚洲超碰97人人做人人爱| 国精产品一区一区三区mba桃花| 在线观看日韩一区| 中文字幕一区二区三区四区不卡| 久久er99精品| 日韩精品在线看片z| 男男gaygay亚洲| 精品国免费一区二区三区| 亚洲国产日韩精品| 欧美在线免费视屏| 亚洲欧洲精品一区二区三区不卡| 国产91精品一区二区麻豆网站| 欧美另类videos死尸| 日本系列欧美系列| 欧美人与禽zozo性伦| 日韩国产欧美在线观看| 欧美午夜精品久久久久久超碰| 欧美成人免费网站| 日韩欧美高清dvd碟片| 91精品国产免费久久综合| 欧美日韩免费高清一区色橹橹 | 欧美一区永久视频免费观看| 91麻豆国产自产在线观看| 99国产精品国产精品久久| 色综合夜色一区| 欧美日韩国产高清一区二区| 欧美日韩成人在线| 欧美精品xxxxbbbb| 欧美人与z0zoxxxx视频| 日韩三级精品电影久久久 | 久久久欧美精品sm网站 | 国产一区二区女| 国产成人亚洲综合色影视| 国产成人在线视频免费播放| 色婷婷亚洲一区二区三区| 91精品国产日韩91久久久久久| 精品精品国产高清一毛片一天堂| 精品盗摄一区二区三区| 国产精品久久午夜夜伦鲁鲁| 日韩不卡在线观看日韩不卡视频| 国产婷婷一区二区| 欧美成人精品1314www| 色噜噜狠狠成人中文综合| 国产精品一区二区在线看| 欧美一区二区视频在线观看2022| 欧美国产一区在线| 性做久久久久久免费观看| 国产主播一区二区| 亚洲成人一二三| 五月综合激情日本mⅴ| 日日骚欧美日韩| 日韩电影在线看| 久久99久久99小草精品免视看| 三级欧美在线一区| 亚洲美女视频一区| 亚洲成a人v欧美综合天堂下载| 亚洲欧洲精品成人久久奇米网| 亚洲图片欧美激情| 国产精品久久久久久久久动漫| 中文字幕在线不卡视频| 亚洲视频免费看| 免费av网站大全久久| 丝袜亚洲精品中文字幕一区| 午夜国产不卡在线观看视频| 亚洲电影一级片| 激情六月婷婷久久| 99在线精品免费| 日韩欧美国产系列| 亚洲你懂的在线视频| 狠狠久久亚洲欧美| 欧洲生活片亚洲生活在线观看| 7878成人国产在线观看| 国产精品美女视频| 免费人成精品欧美精品| 丁香天五香天堂综合| 9191久久久久久久久久久| 久久久不卡网国产精品二区| 亚洲第一会所有码转帖| 国产一区二区三区四区五区美女| 色综合久久综合| 成人免费在线观看入口| 青娱乐精品视频在线| 色综合久久久久| 国产精品久久久久一区二区三区共| 天天色综合天天| 3atv一区二区三区| 一区二区三区在线播| 成人a级免费电影| 综合电影一区二区三区| 不卡av免费在线观看| 国产视频一区在线播放| 国产在线视频一区二区三区|