加勒比久久综合,国产精品伦一区二区,66精品视频在线观看,一区二区电影

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

代寫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號線
  • 短信驗證碼 目錄網 排行網

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

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

    精品1区2区3区4区| 99综合久久| 国产一区91| 久久国产精品免费精品3p| 欧美日本免费| 国产综合色区在线观看| 一本色道久久综合亚洲精品不卡| www.豆豆成人网.com| 一区二区电影| 国产91亚洲精品久久久| 日韩主播视频在线| 婷婷精品进入| 精品午夜久久| 日韩a级大片| 亚洲网色网站| 日韩成人精品一区二区三区| 国产精品久久观看| 夜夜嗨av一区二区三区网站四季av| 精品国产午夜肉伦伦影院| 亚洲日本三级| 欧美日韩一区二区国产| 久久精品国产亚洲一区二区三区| 97久久视频| 免费人成在线不卡| 99国产精品| 久久男女视频| 第九色区aⅴ天堂久久香| 日韩电影免费一区| 亚洲欧洲美洲国产香蕉| 亚洲一区二区三区| 亚洲精品影院在线观看| 99精品久久| 日日夜夜综合| 99精品国自产在线| 国产一区二区三区国产精品| 国产在线一区不卡| 欧美特黄一区| 在线精品视频在线观看高清| 亚洲国内欧美| 欧美不卡在线| 欧美高清一区| 婷婷久久国产对白刺激五月99| 激情视频一区二区三区| 亚洲第一毛片| 亚洲福利国产| 免费观看久久av| 久草在线成人| 亚洲精彩视频| 亚洲一区自拍| 日本午夜一区| 黄毛片在线观看| 密臀av在线播放| 国产91欧美| 日韩高清在线不卡| 欧美区亚洲区| 国产中文欧美日韩在线| 亚洲理论电影| 中文一区二区三区四区| 99久久免费精品国产72精品九九 | 蜜桃在线一区二区三区| 成人一级毛片| 日韩在线观看| 福利一区视频| 青草国产精品久久久久久| 另类综合日韩欧美亚洲| 国产精品777777在线播放 | 精品国内自产拍在线观看视频| 精品理论电影在线| 国产真实久久| 久久电影一区| 日韩精品永久网址| 99精品国产福利在线观看免费| 亚洲精品国产日韩| 亚洲尤物av| 美女网站色精品尤物极品姐弟| 欧美福利专区| 蜜臀精品久久久久久蜜臀| 女人高潮被爽到呻吟在线观看| 欧美激情三区| 国产精品探花在线观看| 粉嫩久久久久久久极品| 99视频精品视频高清免费| 最新国产乱人伦偷精品免费网站| 国产精品久久久久久久久妇女| av免费在线一区| 一区二区影院| 欧美激情15p| 狠狠综合久久| 国产精品精品国产一区二区| 日本中文字幕视频一区| 国产午夜久久av| 欧美顶级毛片在线播放| 爽爽淫人综合网网站| 欧美美女在线| 一区二区中文字幕在线观看| 久久久久久久久久久9不雅视频 | 精品欧美久久| 免费欧美日韩国产三级电影| 成人国产精品入口免费视频| 久久97视频| 欧美日中文字幕| 日本欧美在线观看| 一区二区三区福利| 久久一级大片| 成人短片线上看| 青草综合视频| 美女毛片一区二区三区四区最新中文字幕亚洲 | 欧美影院三区| av中文在线资源库| 国色天香一区二区| 欧美18免费视频| 国产精品videosex性欧美| 一区二区三区国产在线| 亚洲精品在线国产| 蜜桃av一区二区三区| 一区二区三区高清视频在线观看| 欧美不卡在线观看| 国产农村妇女精品一二区| 粉嫩91精品久久久久久久99蜜桃| 亚洲第一福利专区| 99在线观看免费视频精品观看| 久久国产欧美日韩精品| 一区视频网站| 免费成人在线网站| 亚洲国产免费看| 久久精品在线| 日本国产欧美| 欧美三级第一页| 色婷婷一区二区三区| 99精品视频在线免费播放| 亚洲午夜黄色| 色狠狠一区二区三区| 欧美成人专区| 成人日韩精品| 91嫩草精品| 亚洲黄色免费看| 亚洲精品亚洲人成在线| 丝袜国产日韩另类美女| 亚洲精品裸体| 国产精品88久久久久久| 日韩国产精品大片| 亚洲特级毛片| 日韩成人精品一区二区三区| 欧美a级网站| 成人va天堂| 精品国产中文字幕第一页| 日韩不卡在线| 999国产精品999久久久久久| 亚洲日本网址| 精品国产91| 亚洲国产伊人| 国内精品伊人久久久| 久久精品国产精品青草| 欧美美女视频| 亚洲三级网站| 国产午夜久久| 国产中文精品久高清在线不| 在线视频免费在线观看一区二区| 热久久一区二区| 日韩欧美精品一区二区综合视频| 99re8这里有精品热视频8在线| 日本三级一区| 欧美调教在线| 三级成人在线视频| 一区二区亚洲| 亚洲欧洲色图| 日韩免费av| 久久精品卡一| 国产精品magnet| 免费看精品久久片| 综合伊人久久| 国产精品一区亚洲| 亚洲经典在线| 欧美日韩播放| 欧美成人精品三级网站| 欧美一区二区三区高清视频| 亚洲综合伊人| 国产精品粉嫩| 香蕉视频一区二区三区| 国产精品1区| 最近在线中文字幕| 久久精品国产99久久| 99久久久成人国产精品| 欧美无毛视频| 波多野结衣一区| 日韩美脚连裤袜丝袜在线| 日韩精品麻豆| 亚洲精品久久| 一区二区三区自拍视频| 麻豆91在线播放| 欧美激情偷拍自拍| 激情丁香综合| 无码少妇一区二区三区| 久久精品理论片| 蜜臀av性久久久久蜜臀aⅴ四虎| 成人中文字幕视频| 一区二区在线| 91p九色成人| 蜜芽一区二区三区| 伊人久久综合影院|