Coding Quiz Challenge

Enter your initials.

Test your knowledge of Javascript by answering a series of questions.

Welcome to Code Quiz!

Are you ready to test your knowledge about code quiz?!

You will have 100 seconds to complete the quiz made up of 9 questions.

The Totally Awesome Quiz of Useless Information

Start Quiz Submit

With supporting text below as a natural lead-in to additional content??

Javascript Code Quiz!

Here are some Javascript questions.

Answer them all as quickly as you can and try to get the HIGH SCORE.

Note that incorrect answers will result in a 10 second time penalty.

You can try as many times as you want to get the high score!

Your score is .

Enter your initials: Submit

The Code Quiz!

Welcome to The Code Quiz! This is your chance to demonstrate your impeccable coding knowledge.

The game is simple. Rack up as many points in the allotted time by answer questions correctly! Answer incorrectly and you'll lose time on the clock - so choose wisely. Good luck :)

Congratulations, you finished the quiz! Your tallied score is:

Points earned:

Final score:

Submit your name below to enter the (local) HALL OF FAME! To the annals of (local) history!

Coding Quiz Challenge

Try to answer the following code-related question within the time limit. Keep in mind that incorrect answers will penalize your score/time by ten seconds!

Quiz Question

Quiz completed.

You scored: 0

60 Second JavaScript Quiz

Answers for Quizzes & Assignments that I have taken

Coursera and edx assignments.

This repository is aimed to help Coursera and edX learners who have difficulties in their learning process. The quiz and programming homework is belong to coursera and edx and solutions to me.

AWS Certified Solutions Architect - Professional

Devops on aws specialization, open source software development, linux and git specialization, edhec - investment management with python and machine learning specialization.

EDHEC - Portfolio Construction and Analysis with Python

EDHEC - Advanced Portfolio Construction and Analysis with Python

Google Data Analytics Professional Certificate

Google - Foundations: Data, Data, Everywhere

Google - Ask Questions to Make Data-Driven Decisions

Google - Prepare Data for Exploration

Google - Process Data from Dirty to Clean

Google - Analyze Data to Answer Questions

Google - Share Data Through the Art of Visualization

Google - Data Analysis with R Programming

Google - Google Data Analytics Capstone: Complete a Case Study

University of Michigan - PostgreSQL for Everybody Specialization

The university of melbourne & the chinese university of hong kong - basic modeling for discrete optimization, stanford university - machine learning, imperial college london - mathematics for machine learning specialization.

Imperial College London - Linear Algebra

Imperial College London - Multivariate Calculus

University of Colorado Boulder - Excel/VBA for Creative Problem Solving Specialization

  • University of Colorado Boulder - Excel/VBA for Creative Problem Solving, Part 1

University of Washington - Machine Learning Specialization

University of Washington - A Case Study Approach

University of Washington - Regression

Rice University - Python Data Representations

Rice university - python data analysis, rice university - python data visualization, johns hopkins university - data science specialization.

Johns Hopkins University - R Programming

Johns Hopkins University - Getting and Cleaning Data

Johns Hopkins University - Exploratory Data Analysis

Johns Hopkins University - Reproducible Research

Saint Petersburg State University - Competitive Programmer’s Core Skills

Rice university - business statistics and analysis capstone, university of california, san diego - object oriented programming in java, university of california, san diego - data structures and performance, university of california, san diego - advanced data structures in java, ibm: applied data science specialization.

IBM: Open Source tools for Data Science

IBM: Data Science Methodology

IBM: Python for Data Science

IBM: Databases and SQL for Data Science

IBM: Data Analysis with Python

IBM: Data Visualization with Python

IBM: Machine Learning with Python

IBM: Applied Data Science Capstone Project

deeplearning.ai - TensorFlow in Practice Specialization

deeplearning.ai - Introduction to TensorFlow for Artificial Intelligence, Machine Learning, and Deep Learning

deeplearning.ai - Convolutional Neural Networks in TensorFlow

deeplearning.ai - Natural Language Processing in TensorFlow

deeplearning.ai - Sequences, Time Series and Prediction

Alberta Machine Intelligence Institute - Machine Learning Algorithms: Supervised Learning Tip to Tail

University of helsinki: object-oriented programming with java, part i, the hong kong university of science and technology - python and statistics for financial analysis, google it automation with python professional certificate.

Google - Crash Course on Python

Google - Using Python to Interact with the Operating System

Delft University of Technology - Automated Software Testing

University of maryland, college park: cybersecurity specialization.

University of Maryland, College Park: Software Security

University of Maryland, College Park: Usable Security

University of Maryland, College Park: Programming Mobile Applications for Android Handheld Systems: Part 1

Harvard university - introduction to computer science cs50x, duke university - java programming: principles of software design, duke university - java programming: solving problems with software, duke university - java programming: arrays, lists, and structured data, duke university - data science math skills, massachusetts institute of technology - introduction to computer science and programming using python 6.00.1x, massachusetts institute of technology - introduction to computational thinking and data science 6.00.2x, johns hopkins university: ruby on rails web development specialization.

Johns Hopkins University - Ruby on Rails

Johns Hopkins University - Rails with Active Record and Action Pack

Johns Hopkins University - Ruby on Rails Web Services and Integration with MongoDB

Johns Hopkins University - HTML, CSS, and Javascript for Web Developers

Johns Hopkins University - Single Page Web Applications with AngularJS

University of Michigan - Web Design for Everybody: Web Development & Coding Specialization

University of Michigan - HTML5

University of Michigan - CSS3

University of Michigan - Interactivity with JavaScript

Stanford University - Introduction to Mathematical Thinking

University of london - responsive website development and design specialization.

University of London - Responsive Web Design

University of London - Web Application Development with JavaScript and MongoDB

University of London - Responsive Website Tutorial and Examples

University of California, San Diego - Biology Meets Programming: Bioinformatics

University of toronto - learn to program: the fundamentals, university of toronto - learn to program: crafting quality code, university of british columbia - how to code: simple data htc1x, university of british columbia - software construction: data abstraction, university of british columbia - software construction: object-oriented design.

  • You are expected to work individually.
  • Due: Monday April 1st at 11pm EST (Baltimore time).
  • This assignment is worth 70 points.
  • Testing Randomness and I/O
  • Rest API Testing
  • Load Testing metrics
  • CI/CD, Github Actions, Docker

You can get all the starter files for task 4 this homework by doing a git pull on the course public repo . The files can be found under hw/hw4 .

Task 1 (8 points) #

Answer the following quesiotn:

  • Why throughput is a valuable and important metric when it comes to load testing? Explain clearly with at least two reasons.

Deliverables

The deliverables for this task is your answers to the questions above saved in a document named task1 e.g. task1.pdf .

Task 2 (20 points) #

Using JUnit 5 and rest-assured , write separate unit tests to test the following end points on https://jsonplaceholder.typicode.com/ :

  • [ test 1 ]: when a GET request is sent to /albums endpoint, verify that an entry with the title "omnis laborum odio" exists.
  • [ test 2 ]: when a GET request is sent to /comments endpoint, verify that the returned JSON response contains at least 200 comments.
  • [ test 3 ]: when a GET request is sent to /users endpoint, verify that a user named "Ervin Howell" with username "Antonette" and zipcode of "90566-7771" exists.
  • [ test 4 ]: when a GET request is sent to /comments endpoint, verify that there are comments from people whose email address end in .biz .
  • [ test 5 ]: Create a new post by sending a http POST request to /posts endpoint with this info:

You will find rest-assured 's "Getting Started" and "User Guide" documentations helpful to develop the above tests.

The deliverables for this part are your separate JUnit tests, for the 5 test scenarios mentioned above, saved in a java class named JsonplaceholderRestAPITest.java saved under task2 folder.

Task 3 (25 points) #

You need to unit test the guessingNumberGame function within GuessNumber class.

The function implements a number-guessing game. Read the documentation and play the game to develop an understanding of the game. Write JUnit tests to verify that the function behaves as expected (as specified in the documentation). Write your tests in a class named GuessNumberIOTest . You must write as many different test cases as you can here and aim to reveal as many faults as you can. For each successful test case (i.e., a test case that fails), make a comment on top of it and explain in details why you think this failure is happening and provide a possible description of the underlying fault.

Since the function under test here mainly works with standard i/o, you need to use the techniques discussed in class to successfully test this funciton.

You may run the jar file in a terminal via the command java -cp ./guessnumber.jar GuessNumber .

The folder named doc inside task3 contains the documentation of the program in html format.

As given in the documentation, the guessingNumberGame function returns the randomly generated number. In this part, your task is to probe the distribution of the random numbers generated. In particular, you need to verify that the random numbers generated (i.e., the return value of the function) has (roughly) a uniform distribution. To this aim, you are asked to have the funciton run 30,000 times and store the results of the return random numbers. Fix the seed value at 0 on the random generator you pass in for all runs . Verify that all numbers between 1 and 100 (inclusive) are generated roughly with similar frequency. In this case, we consider the frequencies to be roughly the same if the frequency of generating any of the numbers is within +50%/-50% of any other numbers in the range. You need to implement this in a JUnit test class named GuessNumberRandomnessTest .

You can make use of or do something similar to what you did in the previous part to automate these runs!

The deliverables for this part are 1) task 3-1: your tests saved in a java class named GuessNumberIOTest.java , and 2) task 3-2: your tests saved in a java class named GuessNumberRandomnessTest.java . Save both of these files under task3 folder.

Task 4 (17 points) #

This task requires you to submit what you finished for the "Task" part in exercise 12, the only difference being the pipeline here must fail if the code coverage OR branch coverage is less than the provious run of the pipeline.

consult the specs of cicirello/jacoco-badge-generator action on Github Action (or specs of the alternate the action that you are using) on how to enable these switches.

The deliverables for this part are: 1) the complete project folder stored in task4 folder, 2) url to the github repo where all files are stored. Make sure to make this github repo public for the time being so we can verify your files and repo, and 3) url to the published (public) image on docker hub. Store the last two items in a file named task4.md inside the task4 folder`.

Submission #

Submissions should be made to Gradescope . Create a zip file named hw4.zip which contains all the deliverables for all the parts. For each task, create a separate folder named taskX, where X is the part number, under which you put all the deliverables for that task. For each task, make sure to submit all the necessary deliverables including JUnit test classes ( .java files NOT .class files), documents, reports etc.

Important Note: If any of your .java files is not compilable/executable for any reason, you will receive a zero for that part. Thus, please make sure all the source files you hand in successfully compile and run!

  • Task 1 (8 points)
  • Task 2 (20 points)
  • Task 4 (17 points)

godzilla-quiz

Homework-four.

Godzilla Code Quiz

This application will run the user through a Godzilla themed quiz. The user will then be able to track their scores in the same session, and see these scores at any time. Scores are based off of how many seconds are remaining when all of the questions are answered.

Utilizing the App

  • View the app: Here
  • Read through instructions on first page to start the quiz. Once the white button is clicked, the questions will appear and a timer starting at 75 seconds will begin counting down.
  • User will work their way through the quiz by clicking the buttons of their choice.
  • Once all questions are answered, user will then see their score on the screen. User will then be able to type in initials, and hit the Submit button. This score will be submitted to the High Scores list.
  • To view the high scores list for that web session, you can simply click the ‘View High Scores’ button in the top left of the screen. This button will allow the user to toggle the visibility of the list!

Contributers

  • Jordan Smith

JavaScript Tutorial

code quiz homework 4 github

Quiz Application in JavaScript with Validation (Step by Step)

kindsonthegenius

In an earlier tutorial, I explained how to build a basic quiz application in JavaScript.

Now, in this tutorial, we would address some issued we raised. For instance, how do we randomize the questions. Also, how do we allow the user to restart the quiz.  So let’s get started!

I would also recommend you watch the video for more explanation

  • The HTML File
  • CSS Classes
  • The JavaScript
  • The randomNumber() Function
  • The check() Function

Before you begin:

Create a folder where you’ll place all your files.

Inside this file, create a another folder called img. This folder will hold the images.

1. The HTML File

So I’ll provide you the html file. For simplicity, I have provided only the content of the body section of the file.

What I want you to do is to take some time to understand the classes and ids in the html file. This is because, our JavaScript file would rely heavily on these elements.

2. The Classes and Styles

All the classes you see in the html file are defined in the styles.css file. You can get the complete file here . You can now add the stylesheet to your html page. Do this by adding this line to the head section.

After applying the style, you can preview your page, this is what you’ll see (but without the text)

Quiz Application in JavaScript with Validation

3. The JavaScript File

I have actually written the script file in a very simple way. You’ll see that it is made up of functions and variables. Now I have added comments to the file to help you clearly understand it.

Also take note of the array of questions. Feel free to add more questions if you want.

Here is the link to the script file.

However, I would explain part of the code here to make sure you understand the logic.

4. The randomQuestion() Function

This function is responsible for selecting a random question from the array of questions. It also ensures that duplicate questions are not selected.

How it works

I have added line numbers to be able to explain how it works

Line 1 : a random number between 1 and the total questions is returned. The Math.random() returns a floating point number between 0 and 1. Then it is multiplied by the total questions. Finally, it is rounded off to the next integer value. For example, if Math.random() returns 0.3 and the total questions is 5. Then we would have 1.5. It is then rounded off to 2. And so on.

Lines 4 to 6 : if the index is up to the total questions, then the quiz ends. Note that the index is incremented every time  a question is loaded.

Line 9 to 11: if the random number is found in list of answered questions, then we select another random number

Line 13, 14 : set the random number to current index and load the question at the current index

Lines 8, 17 to 20 : this lines checks that for the very first question (answeredQuestion = 0 that is, no question have been answered), just load the question using the current index without checking for any duplicate.

Line 22: any answered question is added to an array of answered questions

5. The check() Function

This function check if an option selected by the user is the correct option. Take a look at the code below and then we’ll discuss it.

First, the ids of the elements are numbers 1 to 4. Similarly, the answers to the questions are numbered 1 to 4.

So if the id of the clicked element equals the answer to the current question, then do three things:

  • add the ‘correct’ style to the class
  • update the answersTracker
  • updates the score

However, if the answer is wrong, we add the ‘wrong’ style and update the answersTracker

Regardless, we just disable click for other buttons.

Other functions I would like you to review by yourself includes:

  • disableClick()

code quiz homework 4 github

kindsonthegenius

You might also like.

Quiz App Using IndexedDB

Build a Quiz App – Store Data in Client-Side IndexedDB

code quiz homework 4 github

Quiz App in JavaScript – Step by Step with all Codes

guest

[…] Quiz Application in JavaScript with Validation (Step by Step) […]

Instant

How to shuffle the option order in above javascript code

Instantly share code, notes, and snippets.

@qmmr

qmmr / main.py

  • Download ZIP
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Embed Embed this gist in your website.
  • Share Copy sharable link for this gist.
  • Clone via HTTPS Clone using the web URL.
  • Learn more about clone URLs
  • Save qmmr/ca6896428b4f9378d738ea8933fc048b to your computer and use it in GitHub Desktop.

@Amit-Dhussa

Amit-Dhussa commented Apr 15, 2020

Thank you so much, sir, for helping me to understand the concept of this question.

Sorry, something went wrong.

@JoshTurk2020

JoshTurk2020 commented Aug 9, 2020

The addToLeftovers function is superfluous. Here is how I solvedit:

myUniqueList = [] myLeftovers = []

def addList(newThing): if newThing in myUniqueList: myLeftovers.append(newThing) return False else: myUniqueList.append(newThing) return True

def add2Leftovers(newThing): # This is an uncessary step, right?

I just cut it out and made the addlist function filter to both., myleftovers.append(newthing).

print(myUniqueList) # [] print(addList("Sekiro")) # returns 'True' since it's a new item print(addList("Ghosts of Tsushima")) # returns 'True' since it's a new item print(addList("Sekiro")) # returns 'False' since it's already been added print(myUniqueList) # This includes the new entries print(myLeftovers) # This includes any repeated entries

Can someone explain why the answer includes the superfluous "addToList" function?

@UcheAnyiam

UcheAnyiam commented Dec 10, 2020 • edited

You are a star, thanks for this!

@NadaBatt

NadaBatt commented Dec 27, 2020

Your work one the coding looks effortless. This is my first time ever for coding and I would like more clarification from you if it is possible.

JoshTurk2020 commented Dec 27, 2020 via email

Nadabatt commented dec 27, 2020 via email.

Thank you for offering your time to help me. I did not really understand the first part of the homework (Next, create a function that allows you to add things to that list. Anything that's passed to this function should get added to myUniqueList, unless its value already exists in myUniqueList. If the value doesn't exist already, it should be added and the function should return True. If the value does exist, it should not be added, and the function should return False) and my attempt on it, myUniqueList = [] def Add_To_myUniqueList(): if items in myUniqueList: myUniqueList.append(thing) return True else: return False print(myUniqueList) print(Add_To_myUniqueList("Book")) print(myUniqueList) On Sun, Dec 27, 2020 at 9:04 PM JoshTurk2020 [email protected] wrote: … @JoshTurk2020 commented on this gist. ------------------------------ What exactly did you want to know? On Sun, Dec 27, 2020, 12:58 PM NadaBatt @ . > wrote: > @NadaBatt commented on this gist. > ------------------------------ > Good evening Josh Turk, > well I was asking Marcin Kumorek, but since you have answered I would like > more explanation on the assignment if you could. > > Nada Battyour > > On Sun, Dec 27, 2020 at 8:38 PM JoshTurk2020 @ . > > wrote: > > > @JoshTurk2020 commented on this gist. > > ------------------------------ > > Are you asking me? > > > > --Josh > > > > "A language is a dialect with an army and a navy." Max Weinreich > > > > James Joshua Pennington, PhD > > Slavic and Eastern European > > Languages and Literatures > > > > > > On Sun, Dec 27, 2020 at 12:29 PM NadaBatt @ .***> > > wrote: > > > > > @NadaBatt commented on this gist. > > > ------------------------------ > > > > > > Your work one the coding looks effortless. This is my first time ever > for > > > coding and I would like more clarification from you if it is possible. > > > > > > — > > > You are receiving this because you commented. > > > Reply to this email directly, view it on GitHub > > > < > > > https://gist.github.com/ca6896428b4f9378d738ea8933fc048b#gistcomment-3574369 > > >, > > > or unsubscribe > > > < > > > https://github.com/notifications/unsubscribe-auth/AOGBDTKAMRZWPB2UFQXBN3TSW5VIFANCNFSM4MIPR2FQ > > > > > > . > > > > > > > — > > You are receiving this because you were mentioned. > > Reply to this email directly, view it on GitHub > > < > https://gist.github.com/ca6896428b4f9378d738ea8933fc048b#gistcomment-3574377 > >, > > or unsubscribe > > < > https://github.com/notifications/unsubscribe-auth/ASIUQVOERTGRFNAI4L3O4G3SW5WIVANCNFSM4MIPR2FQ > > > > . > > > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > < https://gist.github.com/ca6896428b4f9378d738ea8933fc048b#gistcomment-3574383 >, > or unsubscribe > < https://github.com/notifications/unsubscribe-auth/AOGBDTNFOKODYPX6P5FTNLDSW5YTRANCNFSM4MIPR2FQ > > . > — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://gist.github.com/ca6896428b4f9378d738ea8933fc048b#gistcomment-3574390 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ASIUQVL5HGWBIHFBDVBH3TTSW5ZMTANCNFSM4MIPR2FQ .

Is it correct?

JoshTurk2020 commented Dec 27, 2020

Hi Nada - Each new item that you append to the list should be unique, otherwise it would be a corpus (where you have multiple tokens for given types). We are just making a list of types (unique words). Therefore you want to create two lists using [] and one function that sorts the words.

I used: myUniqueList = [] myLeftovers = []

This function (def) sorts whether the word belongs to the list (unique words) or to the corpus (repeated words). You can then create a separate function later to count all the tokens of the corpus list (myLeftovers) if you want to do corpus analysis (for frequency counts, etc.). Of course, since you already have 1 token in the LIST of unique words, you would need to do a "+1" calculation to ensure it is counted.

Does that answer your questions?

@mackan84

mackan84 commented Feb 17, 2021

Hello I need some help when I run this code myUniqueList = [] myLeftovers = []

print(myUniqueList) # [] print(addList("Meliodas")) # returns 'True' since it's a new item print(addList("Escanor")) # returns 'True' since it's a new item print(addList("Meliodas")) # returns 'False' since it's already been added print(myUniqueList) # This includes the new entries print(myLeftovers) # This includes any repeated entries

I get [] False False False [] []

Can you explain why the list dont get the words added and why I get Syntax Error on the else statement

UcheAnyiam commented Feb 21, 2021 • edited

Hello I need some help when I run this code myUniqueList = [] myLeftovers = [] def addList(newThing): if newThing in myUniqueList: myLeftovers.append(newThing) return False else: myUniqueList.append(newThing) return True print(myUniqueList) # [] print(addList("Meliodas")) # returns 'True' since it's a new item print(addList("Escanor")) # returns 'True' since it's a new item print(addList("Meliodas")) # returns 'False' since it's already been added print(myUniqueList) # This includes the new entries print(myLeftovers) # This includes any repeated entries I get [] False False False [] [] Can you explain why the list dont get the words added and why I get Syntax Error on the else statement

Hey, i've just had a look at your code, and it worked fine. I got the below output: [] True True False ['Meliodas', 'Escanor'] ['Meliodas']

When i copied your code and ran it, i got a few indentation errors, so i tidied it up a bit, i dont know if this helps.

@aajupro

aajupro commented Feb 26, 2021

def addToList(thing): if thing in myUniqueList: addToLeftovers(thing) return False else: myUniqueList.append(thing) return True

def addToLeftovers(thing): myLeftovers.append(thing)

#Test the addToList function print(myUniqueList) # [] print(addToList("dog")) # Returns True print(myUniqueList) # ['dog'] print(myLeftovers) # []

#Adding the element that already exists print(addToList("dog")) # Returns False print(myUniqueList) # ['dog'] print(myLeftovers) # ['dog']

#Adding a new element print(addToList("lion")) # Returns True print(myUniqueList) # ['dog','lion'] print(myLeftovers) # ['dog']

@anonymousincognito

anonymousincognito commented Jun 24, 2021

Thank you, I don't know the word "in" so I can't do the homework

JavaScript Quiz

Try to answer a series of code-related questions within the two-minute time limit

☠ BEWARE! ☠

Incorrect answers will result in a deduction of 15 seconds from your remaining time!

You scored out of

Enter your initials and click

'Save' to save your score.

High Scores

Homework 1, Question 8

Cs 7643 deep learning - homework 1.

In this homework, we will learn how to implement backpropagation (or backprop) for “vanilla” neural networks (or Multi-Layer Perceptrons) and ConvNets. You will begin by writing the forward and backward passes for different types of layers (including convolution and pooling), and then go on to train a shallow ConvNet on the CIFAR-10 dataset in Python. Next you’ll learn to use PyTorch , a popular open-source deep learning framework, and use it to replicate the experiments from before.

This homework is divided into the following parts:

  • Implement a neural network and train a ConvNet on CIFAR-10 in Python.
  • Learn to use PyTorch and replicate previous experiments in PyTorch (2-layer NN, ConvNet on CIFAR-10).

Download the starter code here .

Starter code for part 1 of the homework is available in the 1_cs231n folder.

Dependencies are listed in the requirements.txt file. If working with Anaconda, they should all be installed already.

Download data.

Compile the Cython extension. From the cs231n directory, run the following.

Q8.1: Softmax Regression (3 points)

Work through softmax.ipynb and implement the Softmax classifier. Here is a brief summary and if you need a detailed tutorial to brush up your knowledge, this is a nice place.

Before we go into the details of a classifier, let us assume that our training dataset consists of \(N\) instances \(x_i \in \mathbb{R}^D \) of dimensionality \(D\). Corresponding to each of the training instances, we have labels \(y_i \in {1,2,\dotsc ,K }\), where \(K\) is the number of classes. In this homework, we are using the CIFAR-10 database where \(N=50,000\), \(K=10\), \(D= 32 \times 32 \times 3\) (image of size \(32 \times 32\) with \(3\) channels - Red, Green, and Blue).

Classification is the task of assigning a label to the input from a fixed set of categories or classes. A classifier consists of two important components:

Score function: This maps every instance \(x_i\) to a vector \(z_i\) of dimensionality \(K\). Each of these entries represent the class scores for that image:

\[ z_i = Wx_i + b \]

Here, W is a matrix of weights of dimensionality \(K \times D\) and b is a vector of bias terms of dimensionality \(K \times 1\). The process of training is to find the appropriate values for W and b such that the score corresponding to the correct class is high. In order to do this, we need a function that evaluates the performance. Using this evaluation as feedback, the weights can be updated in the right ‘direction’ to improve the performance of the classifier.

Before proceeding, we’ll incorporate the bias term into \(W\), making it of dimensionality \(K \times (D+1)\). Also let a superscript \(j\) denote the \(j^{th}\) element of \(z_i\) and \(w_j\) be the \(j^{th}\) row of W so that \(z_i^j = w_j^Tx_i\). Finally apply the softmax function to compute probabilities (for the \(i\)th example and \(j\)th class):

\[ p_i^j = \frac{e^{z_i^{j}}}{\sum_k e^{z^k_i}} \]

Loss function: This function quantifies the correspondence between the predicted scores and ground truth labels. Softmax regression uses the cross-entropy loss:

\[ L = - \frac{1}{N}\sum_{i=1}^{N}\log \left( p_i^{y_i} \right) \]

If the weights are allowed to take values as high as possible, the model can overfit to the training data. To prevent this from happening a regularization term \(R(W)\) is added to the loss function. The regularization term is the squared some of the weight matrix \(W\). Mathematically,

\[ R(W) = \sum_{k}\sum_{l}W_{k,l}^2 \]

The final loss is

\[ \mathcal{L}(W) = L(W) + R(W) \]

The regularization term \(R(W)\) is usually multiplied by the regularization strength \(\lambda\) before adding it to the loss function. \(\lambda\) is a hyper parameter which needs to be tuned so that the classifier generalizes well over the training set.

The next step is to update the weight parts such that the loss is minimized. This is done by Stochastic Gradient Descent (SGD). The weight update is done as:

\[ W := W - \eta \nabla_W \mathcal{L}(W) \]

Here, \(\nabla_W \mathcal{L}\) is the gradient of the loss function and the factor \(\eta\) is the learning rate. SGD is usually performed by computing the gradient w.r.t. a randomly selected batch from the training set. This method is more efficient than computing the gradient w.r.t the whole training set before each update is performed.

Q8.2: Two-layer Neural Network (3 points)

The IPython notebook two_layer_net.ipynb will walk you through implementing a two-layer neural network on CIFAR-10. You will write a hard-coded 2-layer neural network, implement its backward pass, and tune its hyperparameters.

Q8.3: Modular Neural Network (5 points)

The IPython notebook layers.ipynb will walk you through a modular neural network implementation. You will implement the forward and backward passes of many different layer types, including convolution and pooling layers.

Q8.4: ConvNet on CIFAR-10 (2 points)

The IPython notebook convnet.ipynb will walk you through the process of training a (shallow) convolutional neural network on CIFAR-10.

Deliverables

Zip the completed ipython notebooks and relevant files.

PDF files created from each .ipynb using nbconvert .

Submit the generated zip file 1_cs231n.zip and PDF files as stated above.

This part is similar to the first part except that you will now be using PyTorch to implement the two-layer neural network and the convolutional neural network. In part 1 you implemented core operations given significant scaffolding code. In part 2 these core operations are given by PyTorch and you simply need to figure out how to use them.

If you haven’t already, install PyTorch ( please use PyTorch vesion >=0.2 ). This will probably be as simple as running the commands in the Get Started section of the PyTorch page, but if you run in to problems check out the installation section of the github README, search Google, or come to office hours. You may want to go through the PyTorch Tutorial before continuing. This homework is not meant to provide a complete overview of Deep Learning framework features or PyTorch features.

You probably found that your layer implementations in Python were much slower than the optimized Cython version. Open-source frameworks are becoming more and more optimized and provide even faster implementations. Most of them take advantage of both GPUs, which can offer a significant speedup (e.g., 50x). A library of highly optimized Deep Learning operations from Nvidia called the CUDA® Deep Neural Network library (cuDNN) also helps.

You will be using existing layers and hence, this part should be short and simple. To get started with PyTorch you could just jump in to the implementation below or read through some of the documentation below.

  • What is PyTorch and what distinguishes it from other DL libraries? (github README )
  • PyTorch Variables (needed for autodiff)
  • PyTorch Modules
  • PyTorch examples

The necessary files for this section are provided in the 2_pytorch directory. You will only need to write code in train.py and in each file in the models/ directory.

Q8.5: Softmax Classifier using PyTorch (2 points)

The softmax-classifier.ipynb notebook will walk you through implementing a softmax classifier using PyTorch. Data loading and scaffolding for a train loop are provided. In filter-viz.ipynb you will load the trained model and extract its weight so they can be visualized.

Q8.6: Two-layer Neural Network using PyTorch (2 points)

By now, you have an idea of working with PyTorch and may proceed to implementing a two-layer neural network. Go to models/twolayernn.py and complete the TwoLayerNN Module . Now train the neural network using

You will need to adjust hyperparameters in run_twolayernn.sh to achieve good performance. Use the code from softmax-classifier.ipynb to generate a loss vs iterations plot for train and val and a validation accuracy vs iterations plot. Save these plots as twolayernn_lossvstrain.png and twolayernn_valaccuracy.png respectively

Make suitable modifications in filter-viz.ipynb and save visualizations of the weights of the first hidden layer called twolayernn_gridfilt.png .

Q8.7: ConvNet using PyTorch (2 points)

Repeat the above steps for a convnet. Model code is in models/convnet.py and the script to train convnet is in run_convnet.sh . Making suitable modifications to softmax-classifier.ipynb and filter-viz.ipynb , save the plots as twolayernn_lossvstrain.png and twolayernn_valaccuracy.png and the filters learned as convnet_gridfilt.png .

Submit the results by uploading a zip file called 2_pytorch.zip .

PDF file called 2_pytorch.pdf containing all saved .png files.

The following files should be included:

  • Model implementations models/*.py
  • Training code train.py
  • All of the shell scripts used to train the 3 models ( run_softmax.sh , run_twolayernn.sh , run_convnet.sh )
  • Learning curves (loss) and validation accuracy plots from Q8.3 and Q8.4.
  • The version of filter-viz.ipynb used to genepointsrate convnet filter visualizations
  • PDF files created for each subquestion as per deliverables.
  • Log files for each model with test accuracy reported at the bottom

Q8.8 Experiment (Extra credit for 4803, regular credits for 7643: 10 points)

Experiment and try to get the best performance that you can on CIFAR-10 using a ConvNet. Submit your entry on a challenge hosted on EvalAI . The website will show a live leader board, so you can see how your implementation is doing compared to others. In order to prevent you from overfitting to the test data, the website limits the number of submissions to 3 per day, and only shows the leaderboard computed on 10% of the test data (so final standings may change). You will receive 5 pts regular credit for submitting something that beats chance, 5 points extra credit for beating the instructor/TA’s implementation.

Evaluate your best model using test.py and upload the predictions.csv file on EvalAI. To participate, you will have to sign up on EvalAI using your gatech.edu email. Please tell us in your writeup extra.md what you tried.

For getting better performance, some things you can try:

  • Filter size: In part 1 we used 7x7; this makes pretty pictures but smaller filters may be more efficient
  • Number of filters: In part 1 we used 32 filters. Do more or fewer do better?
  • [conv-relu-pool]xN - conv - relu - [affine]xM - [softmax or SVM]
  • [conv-relu-pool]xN - [affine]xM - [softmax or SVM]
  • [conv-relu-conv-relu-pool]xN - [affine]xM - [softmax or SVM]
  • Alternative update steps: AdaGrad, AdaDelta, Adam

Be sure to include the following in the 2_pytorch.zip file

  • Model definition file models/mymodel.py
  • Training log, loss plot, and validation accuracy plot as above
  • List and describe all that you tried in a text file called extra.md
  • Name, Email ID, and Best Accuracy in extra.md

References:

  • CS231n Convolutional Neural Networks for Visual Recognition

© 2019 Georgia Tech

CS 284: Data Structures

Home | Project | --> Home | Canvas | Instructor Source Code | FAQ

  • RE: Fri 1-1:50PM
  • Link can be found in Canvas/Piazza
  • RF: Fri 2-2:50PM

The information below is based on the previous offering of this class (for reference only). The information is subject to potential changes before the start of the Spring 2020 semester.

Class Description

This course is an introductory-level course for preparing undergraduate students at Stevens with the fundamental knowledge on data structures. Data structures are ways to organize information in the computer memory, making it more efficient to store, update and retrieve information. Upon finishing the course work, students are expected to achieve a good understanding on data structure, object-oriented programming, algorithm efficiency, etc; they should be capable of implementing basic data structures including lists, stacks, queues, binary trees, as well as fundamental algorithms including sorting, Hashing, and self-balancing trees. We will use the Java programming language throughout the course. The students are expected to be practice a significant amount of coding, in both computer and paper. This course has a prerequisite course CS 115 (Introduction to CS) and a co-requisite course CS 135 (Discrete Structures).

  • (Abstract Data Types): Understand the role of abstract data types in data structures, being able to use UML to represent ADTs;
  • (Complexity): Derive Big-O notations for diverse non-recursive algorithms and use it to estimate the computational complexity of algorithms;
  • (Collections): Understand the how to use the Collection class, including Lists, Stacks and Queues;
  • (Trees): Implement Binary Search Trees, Max/Min Heaps, Priority Queues in Java, and understand the basic concepts of self-balancing trees;
  • (Sets and Maps): Understand how to use sets and maps;
  • (Sorting): Implement the algorithms of basic sorting algorithms in Java;
  • (JUnit): Use JUnit to test projects;

Textbook: Objects, abstraction, data structures and design using Java . Elliot B. Koffman and Paul A.T. Wolfgang .

Important note: It assumes a basic knowledge of the area such as the material covered by Computer Security I (CS 461). This semester it will expect ability to program in Java and C or C++.

Expected Work

Participation: Students are required to attend all the lectures. Please inform the instructor and the TA via email if you cannot make it to the class due to travel or sickness.

Quizzes: Students are expected to complete a short quiz within 24 hours after each lecture. The quiz contains 4-5 single-choice or multi-choice questions. The quiz is closely related to the respective lecture and is designed to be light-weighted (and hopefully fun) to improve student engagement during the lecture. Quiz is not graded --- students will receive points by simply trying them.

Machine Problem (MP): Students are expected to work on 4-5 MPs throughout the semester. The projects will involve hand-on programming and data analysis, covering various topics that complement the lecture topics. Example topics include tracking user location based on social network data, interacting with Bitcoin APIs, multiple parties performing joint machine-learning without directly exchanging data. The list of project topics will be released later in Spring 2020.

Survey paper: This is for 4-credit student only.

Get Ready for the Class

  • Make sure you have signed up to the Piazza group of this class
  • Check if you have access to the quiz release page
  • Create your git repo via this one-time link
  • Learn how to use git. Some helpful information here

Final Grade Calculator

Late Policy: submit within 24 hours of deadline - 90%, within 48 hours - 70%, over 48 hours - 0 point, 0 if code not compile

Academic Integrity: Students must follow the instructions from the ( Stevens Honor system ). This course will have a zero-tolerance policy regarding plagiarism. You should complete all the assignments and quizzes on your own. You can help your classmates with questions such as how to use the programming language, what the library classes or methods do, what the errors mean, and how to interpret the assignment instructions. You are encouraged to come to both the instructor and the CAs' office hours regarding any questions you have, or email your questions to both the instructors or the CAs. However, you may not give or receive help from others (except the CA) with the actual implementation or answers for any of the assignments or tests. Do not show or share your code with others, and do not view or copy source code from others. For the same reason, you are not allowed to copy and paste a code snippet you found online in the assignments. All electronic work submitted for this course will be archived and subjected to automatic plagiarism detection. Whenever in doubt, please seek clarifications from the instructor. Students who violate the academic intergrity principle of Stevens will be immediately reported to the department and the school (which could leave a permanent mark on the transcript).

If you need special accommodations because of a disability, please contact the instructor through emails.

Thanks to Prof. Gang Wang for the website template

IMAGES

  1. GitHub

    code quiz homework 4 github

  2. GitHub

    code quiz homework 4 github

  3. GitHub

    code quiz homework 4 github

  4. GitHub

    code quiz homework 4 github

  5. GitHub

    code quiz homework 4 github

  6. GitHub

    code quiz homework 4 github

VIDEO

  1. Quiz with answers 🥰country with the most lakes? 🥰#quiz #quizgames #quizchallenge #viralshortvideo

  2. Quiz Application in java with source code

  3. 05. Creating a simple calculator

  4. Javascript Project Quiz App @SkillsYard #project #javascript #webdevelopment

  5. FUTD and Godzilla Earth react to Godzilla Earth vs Legendary vs Shin vs Ultima

  6. GitHub Copilot vs ChatGPT Plus as a Programmer #programming #programmer #learnprogramming #developer

COMMENTS

  1. GitHub

    Code-Quiz. This project was designed as a homework assignment for UNH's coding bootcamp. This is a quiz application using HTML, CSS, and Javascript. This application emphasizes the use of Javascript to provide quiz questions and collect user data to determine whether the answers to a question are correct, this then generates a score and appends ...

  2. GitHub

    Unit 04 Web APIs Homework: Code Quiz. As you proceed in your career as a web developer, you will probably be asked to complete a coding assessment. These assessments are typically a combination of multiple-choice questions and interactive challenges. In this homework assignment, your challenge is to build a code quiz with multiple-choice questions.

  3. GitHub

    A quiz game about Javascript featuring ten questions with four multiple choice answers each. The game is over when the user answers all ten questions or the timer runs out. The user's score is how much time is left in the game, plus or minus the seconds that are added to the timer based on the answers chosen.

  4. GitHub

    Bootcamp week 4 homework. Contribute to cwill2021/code-quiz development by creating an account on GitHub.

  5. GitHub

    Homework#4: Quiz Game. Contribute to comp7589/HW-4---Quiz-Game development by creating an account on GitHub.

  6. Coding Quiz

    Coding Quiz Challenge. Test your knowledge of Javascript by answering a series of questions. Start the quiz. View High Scores Go Back to Start. Time: 0. Coding Quiz Challenge. Test your knowledge of Javascript by answering a series of questions. ...

  7. Welcome to Code Quiz!

    Welcome to Code Quiz! Are you ready to test your knowledge about code quiz?! You will have 100 seconds to complete the quiz made up of 9 questions. If you're ready to start, click on the "Start Quiz!"

  8. Code Quiz

    Questions. With supporting text below as a natural lead-in to additional content?? Go somewhere. Go somewhere

  9. Web API Quiz Game

    Here are some Javascript questions. Answer them all as quickly as you can and try to get the HIGH SCORE. Note that incorrect answers will result in a 10 second time penalty. You can try as many times as you want to get the high score! Start!

  10. The Code Quiz!

    The Code Quiz! Welcome to The Code Quiz! This is your chance to demonstrate your impeccable coding knowledge. The game is simple. Rack up as many points in the allotted time by answer questions correctly! Answer incorrectly and you'll lose time on the clock - so choose wisely. Good luck :) Take the quiz To the (local) Hall of Fame!

  11. JavaScript Quiz

    Try to answer the following code-related question within the time limit. Keep in mind that incorrect answers will penalize your score/time by ten seconds! Start Quiz. Time: 0. Quiz Question. Quiz completed. You scored: 0. Enter initials: Submit. Back to quiz. Correct! Wrong! ...

  12. Code Quiz Challenge #4

    START See High Scores. Submit Score

  13. Interactivity with JavaScript

    Interactivity with JavaScript - Week 4 - Homework. Add the JavaScript code needed to enable auto-complete on this form. Whenever the checkbox is checked, the code should automatically copy the values from Shipping Name and Shipping Zip into the Billing Name and Billing Zip. If the checkbox is unchecked, the Billing Name and Billing Zip should ...

  14. GitHub

    Bootcamp Homework 4. Contribute to steven-f206/Code-Quiz development by creating an account on GitHub.

  15. Coursera and edX Assignments

    Coursera and edX Assignments. This repository is aimed to help Coursera and edX learners who have difficulties in their learning process. The quiz and programming homework is belong to coursera and edx and solutions to me. AWS Certified Solutions Architect - Professional. DevOps on AWS Specialization. Open Source Software Development, Linux and ...

  16. Homework 4

    The deliverables for this part are: 1) the complete project folder stored in task4 folder, 2) url to the github repo where all files are stored. Make sure to make this github repo public for the time being so we can verify your files and repo, and 3) url to the published (public) image on docker hub. Store the last two items in a file named ...

  17. Homework-Four

    Homework-Four. Godzilla Code Quiz. Overview. This application will run the user through a Godzilla themed quiz. The user will then be able to track their scores in the same session, and see these scores at any time. Scores are based off of how many seconds are remaining when all of the questions are answered. Utilizing the App. View the app: Here

  18. Quiz Application in JavaScript with Validation (Step by Step)

    Line 1: a random number between 1 and the total questions is returned. The Math.random () returns a floating point number between 0 and 1. Then it is multiplied by the total questions. Finally, it is rounded off to the next integer value. For example, if Math.random () returns 0.3 and the total questions is 5.

  19. Python Homework Assignment #4: Lists · GitHub

    Python Homework Assignment #4: Lists. GitHub Gist: instantly share code, notes, and snippets. Python Homework Assignment #4: Lists. GitHub Gist: instantly share code, notes, and snippets. ... Finally, add some code below your function that tests it out. It should add a few different elements, showcasing the different scenarios,

  20. Should I commit all my computer science homework assignments to GitHub

    Nov 14, 2013 at 14:15. @RBarryYoung yes, it would. It could also be used to prove that OP is the original author. - Geeky Guy. Nov 14, 2013 at 14:15. Well, you coud also have copied/stolen the homework of a class mate, and put everything to github, pretending you're the original author. - JB Nizet.

  21. Module 4 Challenge

    Try to answer a series of code-related questions within the two-minute time limit. ☠ BEWARE! ☠. Incorrect answers will result in a deduction of 15 seconds from your remaining time! Start Quiz. You scored out of . Enter your initials and click 'Save' to save your score. Save. High Scores.

  22. Homework 1, Question 8

    This homework is divided into the following parts: Implement a neural network and train a ConvNet on CIFAR-10 in Python. Learn to use PyTorch and replicate previous experiments in PyTorch (2-layer NN, ConvNet on CIFAR-10). Download the starter code here. Part 1. Starter code for part 1 of the homework is available in the 1_cs231n folder. Setup

  23. cs284

    Quiz 4 ; Mid-semester, no class on Wed ; Stack 2 slides; ParenChecker.java ; Review of Quiz 4 ... Homework 4 due April 30; Week 14 of May 3: Quiz 7; Review for endterm ; Review for final ; TupleSort.java; ... Do not show or share your code with others, and do not view or copy source code from others. For the same reason, you are not allowed to ...