Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task 4: Full Inference (2 marks) Finally, we can put everything together to compute the output of the whole ANN (e.g., scores) given some input

image text in transcribed
Task 4: Full Inference (2 marks) Finally, we can put everything together to compute the output of the whole ANN (e.g., scores) given some input vector (e.g., pixels). Specifically, the output of the ANN is computed layer-by-layer starting from the input layer, continuing with the inner layer(s) and ending with the output layer. It is worth noting that the outputs of one layer is acting as inputs for the next layer. Think about a way to ensure the correct transfer of data from one layer to the next. Write function inference(x, w, b) that can be used to compute the output of an ANN by adhering to the following specification Input: An inputs list (x), a list of tables of weights (w) and a table of biases (b). Output: A list of numbers corresponding to output of the ANN. The function inference behaves as follows for the example ANN (i.e., visualized in Figure 4), with the weight matrices, and biases table b, (2.1, -3.1 3.8, 1.5 W = (-0.7,4.1) . (-1.2, 1.1) . = (_1.7,2.5) and input vector x = (1,0) -1.1, 4.2) > > > x = [1, 0] > > > w = [[[2.1, -3.1], [-0.7, 4.1]], [[3.8, 1.5], [-1.2, 1.1]]] > > > b = [[-1.1, 4.2], [-1.7, 2.5]] > > > inference(x,w,b) [7.35, 5.15] Next, we will focus on implementing functions that read in and store data from text files

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions

Question

\f

Answered: 1 week ago