COMP 2211 Exploring Artificial Intelligence

Lab 1 NumPy

Review


This part of this lab is a review of NumPy. It aims to refresh your memory of what you have learned in class.

  • Vectorization
  • Array
    • Creating a NumPy array
    • Attributes of NumPy array
    • Indexing
    • Integer Array Indexing
    • Boolean Array Indexing
    • Data Types
    • Array Arithmetic
    • NumPy Functions
    • Broadcasting

Please download the notebook by right clicking and selecting "Save link as...", and opening it using Google Colab. You should see the following if you open the notebook successfully.

Card image cap

Introduction

CIFAR-10 is a very famous dataset of general objects. It consists of 60000 32x32 colour images in 10 classes (categories), with 6000 images per class. There are 50000 training images and 10000 test images. In this lab, we are going to use this dataset to perform some image-related tasks.


CIFAR-10 Official Site

https://www.cs.toronto.edu/~kriz/cifar.html


Lab Work


A number of lab tasks are given to you to practice your NumPy programming skils. Please download the notebook by right click and select "Save link as...", and open it using Google Colab. You should see the following if you open the notebook successfully.




Submission & Deadline

This is an odd numbered lab so no need to submit anything. Have fun playing with the notebooks! ;)

Frequently Asked Questions

  • Q: When should plt.show() (or fig.show()) be used?
    A: Normally, you should use plt.show() (or fig.show()) to display the figure. The function will block the execution of your program until you close the pop up window by pressing 'q'. However, in (some) Jupyter notebook interpreter, it is often not needed. If there are images that aren't shown, you can add plt.show() (or fig.show()) to the end of your code to display the figure.

This list is incomplete; you can help by expanding it


Page maintained by
Homepage