# data[].attributes.body
https://autokeras.com/

# data[].attributes.attachment_link.readable_text
AutoKeras: An AutoML system based on Keras. It is developed by DATA Lab at Texas A&M University. The goal of AutoKeras is to make machine learning accessible for everyone.

Example

Here is a short example of using the package.

For detailed tutorial, please check here.

Installation

To install the package, please use the pip installation as follows:

pip3 install git+https://github.com/keras-team/keras-tuner.git@1.0.2rc4 pip3 install autokeras

Please follow the installation guide for more details.

Note: Currently, AutoKeras is only compatible with Python >= 3.5 and TensorFlow >= 2.3.0.

Community

Twitter: You can also follow us on Twitter@autokeras for the latest news.

Emails: Subscribe our email list to receive announcements.

Questions and Discussions

GitHub Discussions: Ask your questions on our GitHub Discussions. It is a forum hosted on GitHub. We will monitor and answer the questions there.

Instant Communications

Slack: Request an invitation. Use the#autokeras channel for communication.

QQ Group: Join our QQ group 1150366085. Password: akqqgroup

Online Meetings: Join the online meeting Google group. The calendar event will appear on your Google Calendar.

Contributing Code

We engage in keeping everything about AutoKeras open to the public. Everyone can easily join as a developer. Here is how we manage our project.

Triage the issues: We pick the important issues to work on fromGitHub issues. They will be added to thisProject. Some of the issues will then be added to themilestones, which are used to plan for the releases.

Assign the tasks: We assign the tasks to people during the online meetings.

Discuss: We can have discussions in multiple places. The code reviews are on GitHub. Questions can be asked in Slack or during the meetings.

Please join our Slack and send Haifeng Jin a message. Or drop by our online meetings and talk to us. We will help you get started!

Refer to our Contributing Guide to learn the best practices.

Thank all the contributors!

Donation

We accept financial support on Open Collective. Thank every backer for supporting us!

Cite this work

Haifeng Jin, Qingquan Song, and Xia Hu. "Auto-keras: An efficient neural architecture search system." Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining. ACM, 2019. ( Download)

Biblatex entry:

Acknowledgements

The authors gratefully acknowledge the D3M program of the Defense Advanced Research Projects Agency (DARPA) administered through AFRL contract FA8750-17-2-0116; the Texas A&M College of Engineering, and Texas A&M University.

# data[].attributes.attachment_link.description
AutoKeras: An AutoML system based on Keras. It is developed by DATA Lab at Texas A&M University. The goal of AutoKeras is to make machine learning accessible for everyone. Here is a short example of using the package. For detailed tutorial, please check here.

# data[].attributes.headline
NumPy Illustrated: The Visual Guide to Numpy

# data[].attributes.subject
NumPy Illustrated: The Visual Guide to Numpy

# data[].attributes.attachment_link.readable_text
NumPy is a fundamental library that most of the widely used Python data processing libraries are built upon ( pandas, OpenCV), inspired by ( PyTorch), or can efficiently share data with ( TensorFlow, Keras, etc). Understanding how NumPy works gives a boost to your skills in those libraries as well. It is also possible to run NumPy code with no or minimal changes on GPU ¹.

The central concept of NumPy is an n-dimensional array. The beauty of it is that most operations look just the same, no matter how many dimensions an array has. But 1D and 2D cases are a bit special. The article consists of three parts:

I took a great article, " A Visual Intro to NumPy " by Jay Alammar², as a starting point, significantly expanded its coverage, and amended a pair of nuances.

At first glance, NumPy arrays are similar to Python lists. They both serve as containers with fast item getting and setting and somewhat slower inserts and removals of elements.

The hands-down simplest example when NumPy arrays beat lists is arithmetic:

Other than that, NumPy arrays are:

more compact, especially when there's more than one dimension

faster than lists when the operation can be vectorized

slower than lists when you append elements to the end

usually homogeneous: can only work fast with elements of one type

Here O(N) means that the time necessary to complete the operation is proportional to the size of the array (see Big-O Cheat Sheet³ site), and O*(1) (the so-called "amortized" O(1)) means that the time does not generally depend on the size of the array (see Python Time Complexity ⁴ wiki page)

Vector initialization

One way to create a NumPy array is to convert a Python list. The type will be auto-deduced from the list element types:

Be sure to feed in a homogeneous list, otherwise you'll end up with dtype='object', which annihilates the speed and only leaves the syntactic sugar contained in NumPy.

More about dtypes in my new article

NumPy arrays cannot grow the way a Python list does: No space is reserved at the end of the array to facilitate quick appends. So it is a common practice to either grow a Python list and convert it to a NumPy array when it is ready or to preallocate the necessary space with or :

It is often necessary to create an empty array which matches the existing one by shape and elements type:

Actually, all the functions that create an array filled with a constant value have a _like counterpart:

There are as many as two functions for array initialization with a monotonic sequence in NumPy:

If you need a similar-looking array of floats, like [0., 1., 2.], you can change the type of the output: arange(3).astype(float), but there's a better way. The arange function is type-sensitive: If you feed ints as arguments, it will generate ints, and if you feed floats (e.g., arange(3.)) it will generate floats.

But arange is not especially good at handling floats:

This 0.1 looks like a finite decimal number to us but not to the computer: In binary, it is an infinite fraction and has to be rounded somewhere thus an error. That's why feeding a step with fractional part to arange is generally a bad idea: You might run into an off-by-one error. You can make an end of the interval fall into a non-integer number of steps (solution1) but that reduces readability and maintainability. This is where might come in handy. It is immune to rounding errors and always generates the number of elements you ask for. There's a common gotcha with linspace, though. It counts points, not intervals, thus the last argument is always plus one to what you would normally think of. So it is 11, not 10 in the example above.

For testing purposes it is often necessary to generate random arrays:

There's also a new interface for random arrays generation. It is:
- better suited for multi-threading,
- somewhat faster,
- more configurable (you can squeeze even more speed or even more quality by choosing a non-default so-called 'bit generator'),
- able to pass two tricky synthetic tests that the old version fails.

Vector indexing

Once you have your data in the array, NumPy is brilliant at providing easy ways of giving it back:

All of the indexing methods presented above except fancy indexing are actually so-called "views": They don't store the data and reflect the changes in the original array if it happens to get changed after being indexed.

All of those methods including fancy indexing are mutable: They allow modification of the original array contents through assignment, as shown above. This feature breaks the habit of copying arrays by slicing them:

Also, such assignments must not change the size of the array, so tricks like

won't work in NumPy - use np.insert, np.append, etc. instead (described in the "2D" section below).

Another super-useful way of getting data from NumPy arrays is boolean indexing, which allows using all kinds of logical operators:

any and all act just like their python peers, but don't short-circuit

Careful though; Python "ternary" comparisons like 3<=a<=5 don't work here.

As seen above, boolean indexing is also writable. Two common use cases of it spun off as dedicated functions: the excessively overloaded function (see both meanings below) and .

Note that np.where with one argument returns a tuple of arrays (1-tuple in 1D case, 2-tuple in 2D case, etc), thus you need to write np.where(a>5)[0] to get np.array([5,6,7]) in the example above (same for np.nonzero).

Vector operations

Arithmetic is one of the places where NumPy speed shines most. Vector operators are shifted to the c++ level and allow us to avoid the costs of slow Python loops. NumPy allows the manipulation of whole arrays just like ordinary numbers:

The same way ints are promoted to floats when adding or subtracting, scalars are promoted (aka broadcasted) to arrays:

Most of the math functions have NumPy counterparts that can handle vectors:

Scalar product has an operator of its own:

You don't need loops for trigonometry either:

Arrays can be rounded as a whole:

floor rounds to -∞, ceil to +∞ and around - to the nearest integer (.5 to even)

The name np.around is just an alias to np.round introduced to avoid shadowing Python round when you write from numpy import * (as opposed to a more common import numpy as np). You can use a.round() as well.

NumPy is also capable of doing the basic stats:

Each of these functions has a nan-resistant variant: eg nansum, nanmax, etc

As you can see from the formula above, both and ignore Bessel's correction and give a biased result in the most typical use case of estimating std from a sample when the population mean is unknown. The standard approach to get a less biased estimation is to have n-1 in the denominator, which is done with ddof=1 ('delta degrees of freedom'):

Pandas std uses Bessel's correction by default

The effect of the Bessel's correction quickly diminishes with increasing sample size. Also, it is not a one-size-fits-all solution, e.g. for the normal distribution ddof=1.5 is better:

Sorting functions have fewer capabilities than their Python counterparts:

In the 1D case, the absence of the reversed keyword can be easily compensated for by reversing the result. In 2D it is somewhat trickier ( feature request ⁵).

Searching for an element in a vector

As opposed to Python lists, a NumPy array does not have an index method. The corresponding feature request ⁶ has been hanging there for quite a while now.

The square brackets in the definition of index() mean that either j or both i and j can be omitted

One way of finding an element is np.where(a==x)[0][0], which is neither elegant nor fast as it needs to look through all elements of the array even if the item to find is in the very beginning.

A faster way to do it is via accelerating next((i[0] for i, v in np.ndenumerate(a) if v==x), -1) with Numba⁷ (otherwise it's way slower in the worst case than where).

Once the array is sorted though, the situation gets better:v = np.searchsorted(a, x); return v if a[v]==x else -1 is really fast with O(log N) complexity, but it requires O(N log N) time to sort first.

Actually, it is not a problem to speed up searching by implementing it in C. The problem is float comparisons. This is a task that simply does not work out of the box for arbitrary data.

Comparing floats

np.allclose assumes all the compared numbers to be of a typical scale of 1. For example, if you work with nanoseconds, you need to divide the default atol argument value by 1e9: np.allclose(1e-9, 2e-9, atol=1e-17) == False.

math.isclose makes no assumptions about the numbers to be compared but relies on a user to give a reasonable abs_tol value instead (taking the default np.allclose atol value of 1e-8 is good enough for numbers with a typical scale of 1): math.isclose(0.1+0.2-0.3, abs_tol=1e-8)==True.

The function np.allclose(a, b) compares arrays of floats with a given tolerance

Aside from that, np.allclose has some minor issues in a formula for absolute and relative tolerances, for example, for certain a,b allclose(a, b) != allclose(b, a). Those issues were resolved in the (scalar) function math.isclose (which was introduced later). To learn more on that, take a look at the excellent floating-point guide⁸ and the corresponding NumPy issue ⁹ on GitHub.

There used to be a dedicated matrix class in NumPy, but it is deprecated now, so I'll use the words matrix and 2D array interchangeably.

Matrix initialization syntax is similar to that of vectors:

Double parentheses are necessary here because the second positional parameter is reserved for the (optional) dtype (which also accepts integers).

Random matrix generation is also similar to that of vectors:

The ubiquitous double parentheses found their way to the interface of the new-style (see details in the 1D section above) numbers generation routines so that as of today only in has beauty taken prevelence over stringency and convenience of passing shapes as is:

Two-dimensional indexing syntax is more convenient than that of nested lists:

The "view" sign means that no copying is actually done when slicing an array. When the array is modified, the changes are reflected in the slice as well.

The axis argument

In many operations (e.g., ) you need to tell NumPy if you want to operate across rows or columns. To have a universal notation that works for an arbitrary number of dimensions, NumPy introduces a notion of axis: The value of the axis argument is, as a matter of fact, the number of the index in question: The first index is axis=0, the second one is axis=1, and so on. So in 2D axis=0 is column-wise and axis=1 means row-wise.

Generally speaking, the first dimension i (axis=0) is responsible for indexing the rows, so sum(axis=0) should be read like "for any given column sum over all of its rows" rather than just "column-wise". The 2D case is somewhat counter-intuitive: you need to specify the dimension to be eliminated, instead of the remaining one you would normally think about. In higher dimensional cases this is more natural, though: it'd be a burden to enumerate all the remaining dimensions if you only need to sum over a single one.

The notion of the 'axis' argument (called 'dimension' in MATLAB) is actually very simple: it is just number of the index you want the operation to carry over. It is used in many functions in NumPy so it pays off to understand it, but if for some reason it doesn't work out for you, in this particular case you can use the Einstein summation - that's a way to do the sums without 'axes': np.einsum('ij->j', a) is summing column-wise (same as sum(axis=0) in the image above) and np.einsum('ij->i', a) is row-wise (same as sum(axis=1)).

Matrix arithmetic

In addition to ordinary operators (like +,-,*,/,// and **) which work element-wise, there's a @ operator that calculates a matrix product:

As a generalization of broadcasting from scalar that we've seen already in the first part, NumPy allows mixed operations between a vector and a matrix, and even between two vectors:

Note that in the last example it is a symmetric per-element multiplication. To calculate the outer product using an asymmetric linear algebra matrix multiplication the order of the operands should be reversed:

Row vectors and column vectors

As seen from the example above, in the 2D context, the row and column vectors are treated differently. This contrasts with the usual NumPy practice of having one type of 1D arrays wherever possible (e.g., a[:,j] - the j-th column of a 2D array a- is a 1D array). By default 1D arrays are treated as row vectors in 2D operations, so when multiplying a matrix by a row vector, you can use either shape (n,) or (1, n) - the result will be the same. If you need a column vector, there are a couple of ways to cook it from a 1D array, but surprisingly transpose is not one of them:

Two operations that are capable of making a 2D column vector out of a 1D array are reshaping and indexing with newaxis:

Here the -1 argument tells reshape to calculate one of the dimension sizes automatically and None in the square brackets serves as a shortcut for np.newaxis, which adds an empty axis at the designated place.

flatten is always a copy, reshape(-1) is always a view, ravel is a view when possible

So, there's a total of three types of vectors in NumPy: 1D arrays, 2D row vectors, and 2D column vectors. Here's a diagram of explicit conversions between those:
Strictly speaking, any array, all but one dimensions of which are single-sized, is a vector (eg. a.shape==[1,1,1,5,1,1]), so there's an infinite number of vector types in numpy, but only these three are commonly used. You can use np.reshape to convert a 'normal' 1D vector to this form and to get it back. Both functions act as views.
By the rules of broadcasting, 1D arrays are implicitly interpreted as 2D row vectors, so it is generally not necessary to convert between those two - thus the corresponding area is shaded.

Matrix manipulations

There are two main functions for joining the arrays:

Those two work fine with stacking matrices only or vectors only, but when it comes to mixed stacking of 1D arrays and matrices, only the works as expected: The generates a dimensions-mismatch error because as described above, the 1D array is interpreted as a row vector, not a column vector. The workaround is either to convert it to a row vector or to use a specialized column_stack function which does it automatically:

The inverse of stacking is splitting:

Matrix replication can be done in two ways: acts like copy-pasting and like collated printing:

Specific columns and rows can be d like that:

The inverse operation is :

The function, just like hstack, is unable to automatically transpose 1D arrays, so once again, either the vector needs to be reshaped or a dimension added, or column_stack needs to be used instead:

Actually, if all you need to do is add constant values to the border(s) of the array, the (slightly overcomplicated) function should suffice:

Meshgrids

The broadcasting rules make it simpler to work with meshgrids. Suppose, you need the following matrix (but of a very large size):

np.amin is just an alias of np.min to avoid shadowing the Python min when you write 'from numpy import *'

Two obvious approaches are slow, as they use Python loops. The MATLAB way of dealing with such problems is to create a meshgrid:

The function accepts an arbitrary set of indices, - just slices and can only generate the complete index ranges. fromfunction calls the provided function just once, with the I and J argument as described above.

But actually, there is a better way to do it in NumPy. There's no need to spend memory on the whole I and J matrices (even though meshgrid is smart enough to only store references to the original vectors if possible). It is sufficient to store only vectors of the correct shape, and the broadcasting rules take care of the rest:

Without the indexing='ij' argument, meshgrid will change the order of the arguments: J, I= np.meshgrid(j, i) - it is an 'xy' mode, useful for visualizing 3D plots (see the example from the docs).

Aside from initializing functions over a two- or three-dimensional grid, the meshes can be useful for indexing arrays:

Matrix statistics

The argmin and argmax functions in 2D and above have an annoyance of returning the flattened index (of the first instance of the min and max value). To convert it to two coordinates, an unravel_index function is required:

The quantifiers and are also aware of the axis argument:

Matrix sorting

As helpful as the axis argument is for the functions listed above, it is as unhelpful for the 2D sorting:

It is just not what you would usually want from sorting a matrix or a spreadsheet: axis is in no way a replacement for the key argument. But luckily, NumPy has several helper functions which allow sorting by a column - or by several columns, if required:

1. a[a[:,0].argsort()] sorts the array by the first column:

Here returns an array of indices of the original array after sorting.

This trick can be repeated, but care must be taken so that the next sort does not mess up the results of the previous one:
a = a[a[:,2].argsort()]
a = a[a[:,1].argsort(kind='stable')]
a = a[a[:,0].argsort(kind='stable')]

2. There's a helper function which sorts in the way described above by all available columns, but it always performs row-wise, and the order of rows to be sorted is inverted (i.e., from bottom to top) so its usage is a bit contrived, e.g.
- a[np.lexsort(np.rot90(a))] sorts by all columns in left-to-right order.

- a[np.lexsort(np.rot90(a[:,[2,5]]))] sorts by column 2 first and then (where the values in column 2 are equal) by column 5. An alternative form is a[np.lexsort(np.flipud(a.T[[2,5]]))]

Here flips the matrix in the up-down direction (to be precise, in the axis=0 direction, same as a[::-1,...], where three dots mean "all other dimensions"- so it's all of a sudden flipud, not , that flips the 1D arrays) and rotates the matrix in the positive direction (i.e., counter-clockwise) by 90 degrees. Both flips and rot90 return views.

3. To use the order argument of sort, first convert the array to structured form, then sort it, and finally convert it back to the plain ('unstructured') form:

Both conversions are actually views, so they are fast and don't require any extra memory. But the functions u2s and s2u need to be imported first with the horrific from numpy.lib.recfunctions import unstructured_to_structured as u2s, structured_to_unstructured as s2u

4. It might be a better option to do it in Pandas since this particular operation is more readable and less error-prone there:
- pd.DataFrame(a).sort_values(by=[2,5]).to_numpy() sorts by column 2, then by column 5.
- pd.DataFrame(a).sort_values().to_numpy() sorts by all columns in the left-to-right order.

When you create a 3D array by reshaping a 1D vector or converting a nested Python list, the meaning of the indices is (z,y,x). The first index is the number of the plane, then the coordinates go in that plane:

This index order is convenient, for example, for keeping a bunch of gray-scale images: a[i] is a shortcut for referencing the i-th image.

But this index order is not universal. When working with RGB images, the (y,x,z) order is usually used: First are two pixel coordinates, and the last one is the color coordinate (RGB in Matplotlib, BGR in OpenCV):

This way it is convenient to reference a specific pixel: a[i,j] gives an (r,g,b) tuple of the (i,j) pixel.

So the actual command to create a certain geometrical shape depends on the conventions of the domain you're working on:

Obviously, NumPy functions like hstack, vstack, or are not aware of those conventions. The index order hardcoded in them is (y,x,z), the RGB images order:

If your data is laid out differently, it is more convenient to stack images using the concatenate command, feeding it the explicit index number in an axis argument:

If thinking in terms of axes numbers is not convenient to you, you can convert the array to the form that is hardcoded into hstack and co:

This conversion is cheap: No actual copying takes place; it just mixes the order of indices on the fly.

Another operation that mixes the order of indices is array transposition. Examining it might make you feel more familiar with 3D arrays. Depending on the order of axes you've decided on, the actual command to transpose all planes of your array will be different: For generic arrays, it is swapping indices 1 and 2, for RGB images it is 0 and 1:

Interesting though that the default axes argument for (as well as the only a.T operation mode) reverses the index order, which coincides with neither of the index order conventions described above.

Broadcasting works with higher dimensions as well, see my note " Broadcasting in NumPy " for details.

And finally, here's a function that can save you a lot of Python loops when dealing with the multidimensional arrays and can make your code cleaner - (Einstein summation):

It sums the arrays along the repeated indices. In this particular example np.tensordot(a, b, axis=1) would suffice in both cases, but in the more complex cases einsum might work faster and is generally easier to both write and read - once you understand the logic behind it.

If you want to test your NumPy skills, there's a tricky crowd-sourced set of 100 NumPy exercises ¹⁰ on GitHub.

Let me know (on reddit, hackernews, or twitter) if I have missed your favorite NumPy feature, and I'll try to fit it in!

All rights reserved (=you cannot distribute, alter, translate, etc. without author's permission).

# data[].attributes.attachment_link.title
NumPy Illustrated: The Visual Guide to Numpy

# data[].attributes.attachment_link.description
NumPy is a fundamental library that most of the widely used Python data processing libraries are built upon ( pandas, OpenCV), inspired by ( PyTorch), or can efficiently share data with ( TensorFlow, Keras, etc). Understanding how NumPy works gives a boost to your skills in those libraries as well.

# data[].attributes.headline
Google Colab - Default Machine Learning environment for the module, cloud based, no installation required

# data[].attributes.subject
Google Colab - Default Machine Learning environment for the module, cloud based, no installation required

# data[].attributes.headline
Anaconda - if you want to set up a Machine Learning environment on your own computer

# data[].attributes.subject
Anaconda - if you want to set up a Machine Learning environment on your own computer

# data[].attributes.body
https://www.anaconda.com/

# data[].attributes.attachment_link.title
Anaconda | The World's Most Popular Data Science Platform

# data[].attributes.attachment_link.description
Anaconda is the birthplace of Python data science. We are a movement of data scientists, data-driven enterprises, and open source communities.

# data[].attributes.attachment_link.readable_text
Tutorials on the scientific Python ecosystem: a quick introduction to central tools and techniques. The different chapters each correspond to a 1 to 2 hours course with increasing level of expertise, from beginner to expert.

Release: 2020.2

# data[].attributes.attachment_link.title
Scipy Lecture Notes - Scipy lecture notes

# data[].attributes.attachment_link.description
Tutorials on the scientific Python ecosystem: a quick introduction to central tools and techniques. The different chapters each correspond to a 1 to 2 hours course with increasing level of expertise, from beginner to expert. Release: 2020.2

# data[].attributes.headline
BSc AI and Data Science programme is coming to UoN

# data[].attributes.subject
BSc AI and Data Science programme is coming to UoN

# data[].attributes.body
https://www.northampton.ac.uk/courses/artificial-intelligence-and-data-science-bsc-hons/

# data[].attributes.attachment_link.readable_text
COVID-19 Updates: For advice and updates for staff, students, and applicants who may have concerns about the coronavirus outbreak please visit our Situation Updates page.

Skip to content

What are you looking for?

Key Facts

3 years full time
4 years full time (with Foundation)
4-6 years part time

Full Time 22/23: £9,250 Part Time 22/23: £1,500 per 20 credit module
Integrated Foundation Year 22/23: £9,250

Full Time 22/23: £14,000
Integrated Foundation Year 22/23: £14,000

Get in touch

For questions regarding study and admissions please contact us:

UK/EU Students enquiries

study@northampton.ac.uk
0300 303 2772

International Students enquiries

international@northampton.ac.uk
+44 (0)1604 894503

Overview
Available to apply through UCAS
Artificial intelligence and data science have a pivotal role in driving a new era of innovation in computer science, public health, manufacturing, transportation, and many other areas. Artificial Intelligence and Data Science BSc (Hons) equips students with research, design, and programming skills to apply artificial intelligence concepts and techniques in the context of real-world industrial and business scenarios. Using a state-of-the-art AI lab, students develop and deploy applied AI solutions individually and as part of a team.

Highlights

Take a look around our Waterside campus

If you'd like to see more of our Waterside campus, come and join us for a socially distanced CAMPUS TOUR.
Book a Campus Tour

UoN Computing society & IEEE

The Computing Society aims to bring together students interested in computing and to provide as much insight into the industry as possible by giving its members the opportunity to network with potential clients and employers. We believe that a sense of belonging, of growing together is what makes the whole university experience 100 times more memorable and work to create an environment where everyone partakes in the learning and development path of the others.

In addition to this, students will have the opportunity to join the world's largest professional body at discount rates and join the UON IEEE Student Branch, through which they can get in contact with students from other academic institutes worldwide.

Course Content

Course Details

The artificial intelligence and data science course will equip you with a range of knowledge and practical skills required to establish your career as a machine learning software engineer, solution architect, project manager or AI research scientist. You will learn fundamentals and applications of data science and machine learning progressively over the course period.

Year 1

During your first year of this programme, you will study common computer science modules which give you the foundation and flexibility to specialise in your second and third years. Additionally, you'll study a specialised module that is tailored for artificial intelligence and data science programme students.

Year 2

In your second year, you will continue your journey with more specialised modules such as Introduction to AI, Cloud Computing and Big Data, and Relational Databases along with other computer science modules. You will also complete a group project where you will be a part of a small design team working to produce an innovative and bespoke AI solution to a real-world challenge.

Year 3

In your final year of the degree, you will acquire comprehensive AI skills in advanced modules such as Advanced AI and Applications, Natural Language Processing, Modern Databases, and Media Technology. You'll be able to develop AI applications using computer vision and neural networks and deploy the solutions in the cloud. You'll have an opportunity to complete an independent dissertation on a specialist topic of your choice in the field of artificial intelligence.

Entry Requirements

A typical offer could be BCC at A-Level or DMM at BTEC. Applicants will be expected to have achieved GCSE Mathematics (or equivalent) at grade C/4 or above. We welcome international applicants and applications from students with a range of non-traditional educational or professional qualifications.

For information on how to apply to study with us, please see our How to Apply page.

Integrated Foundation Year (IFY) Entry Requirements

Admission to this foundation course is normally DEE at A Level or MPP at BTEC. However, we would also like to hear from you if you have professional or industry experience instead, a range of other qualifications or self-developed subject knowledge that relates to the course you wish to study.

English Language Requirements

All International and EU students applying for a course with us must meet the following minimum English language requirements:

IELTS 6.0 (or equivalent) with a minimum of 5.5 in all bands
for study at undergraduate level.

For information regarding English language requirements at the University, please see our IELTS page.

Fees and Funding

22/23 Tuition Fees

Fees quoted relate to study in the Academic Year 22/23 only and may be subject to inflationary increases in future years.

UK - Full Time: £9,250

UK - Part Time: £1,500 per 20 credit module

UK - Integrated Foundation Year: £9,250 for the foundation year; thereafter standard fees apply

International - Full Time: £14,000

International - Integrated Foundation Year: £14,000 for the foundation year; thereafter standard fees apply

Additional Costs

There are currently no additional costs anticipated for this course for 2022 entry.

21/22 Tuition Fees

Fees quoted relate to study in the Academic Year 21/22 only and may be subject to inflationary increases in future years.

UK - Full Time: £9,250

UK - Part Time: £1,465 per 20 credit module

UK - Integrated Foundation Year: £6,780

International - Full Time: £13,000

International - Integrated Foundation Year: £13,000

Additional Costs

There are currently no additional costs anticipated for this course for 2021 entry.

For information on the scholarships available to you, please see our scholarships page.

Accreditation

UON are now part of Amazon Web Services (AWS) Academy. Students joining BSc (Hons) Artificial Intelligence and Data Science programme will have the chance to take part in AWS accredited courses and acquire AWS certifications.

As a member of Amazon Web Services (AWS) Academy, the programme includes AWS accredited cloud computing courses to prepare students for industry-recognised certifications and the most in-demand careers in the cloud industry.

Postgraduate Opportunities

Our postgraduate courses are a great way to enhance the skills you have already learnt. Benefit from our 20% alumni discount on postgraduate fees to give you a CV that will catch the eye of employers.
Computing MSc (with or without Placement)

Student Perks

At the University of Northampton, everything we do, from funded trips to paid internships, is to give you everything you need to make a difference when you leave.

If you join this full time degree at Northampton you will receive a laptop when your course begins. The laptops are built to a bespoke custom specification ideal for use in the seminar room, collaborative group work or studying at home.

Whatever your ambitions, we're here to help you to achieve them. We'll support you to identify the skills you're learning during your course, find your strengths and secure practical experience so that when it comes to applying for jobs or further study you'll feel confident in standing out from the crowd. We've created the Northampton Employment Promise because we are so confident that if you focus on your studies and complete one of our awards you'll be highly employable by the time you graduate. Putting you in a great position to secure employment or continue your studies.

To check out the full list of perks visit our Student Perks page.

Frequently Asked Questions (FAQs)

How will I learn on this degree?

While theories are important for AI solutions, we emphasise on practical learning. You will be taught through a variety of activities and problem-solving challenges, so that you can apply your theoretical knowledge creatively. Being able to analyse problems, implement data science methods, research solutions, and apply them in new ways are highly valued in the computing industry, and you will be able to use them throughout your career to drive the industry forward.

You will have access to a dedicated AI lab with state-of-the-art equipment and software for learning. You will receive a laptop (Terms and Conditions apply) to work on your coursework flexibly.

How will I be assessed?

The course uses a range of assessment methods including assignments, portfolios, project reports, and video recordings to demonstrate their strength in knowledge-based skills.

What can I do with a degree in Artificial Intelligence and Data Science?

The artificial intelligence and data science course will help you acquire a range of specialised and general computing skills required to establish your career as a machine learning software engineer, solution architect, project manager or AI research scientist.

Upcoming Open Days

Open Days give you the best experience and insight to courses, people and facilities that interest you. Make your choice easier and come meet us.

Senior Lecturer - Computing
Artificial Intelligence and Data Science BSc (Hons)
View Profile

Lecturer in Computing
Faculty of Arts, Science and Technology
View Profile

Senior Lecturer - Computing
Faculty of Arts, Science and Technology
View Profile

Senior Lecturer - Computing
Dr Mu has over 15 years of experience in immersive media and data science research and teaching. His work has been funded by UK Research and Innovation and European Commission. He is a fellow of the HEA and a member of IEEE and ACM.

Facilities

A state-of-the-art AI lab with specialised computing equipment to support the design, development, and testing of AI applications.

Related Courses

Computing (Computer Networks Engineering) MSc

Our postgraduate Computing (Computer Networks Engineering) MSc allows you develop your research and analytical skills and complete an individual thesis investigating.

Computer Science BSc (Hons)

Our BSc (Hons) Computer Science degree gives you the opportunity to explore different ideas and develop innovative solutions to current issues in the computing industry.

Computer Networks Engineering BSc (Hons)

The Computer Network Engineering programme enables students to develop a range of analytical techniques and problem-solving skills to real-world computer networking scenarios.

# data[].attributes.attachment_link.title
Artificial Intelligence and Data Science BSc (Hons) | University of Northampton

# data[].attributes.attachment_link.description
COVID-19 Updates: For advice and updates for staff, students, and applicants who may have concerns about the coronavirus outbreak please visit our Situation Updates page. Skip to content What are you looking for?

# data[].attributes.attachment_link.title
Python Data Science Handbook | Python Data Science Handbook

# data[].attributes.attachment_link.description
This website contains the full text of the Python Data Science Handbook by Jake VanderPlas; the content is available on GitHub in the form of Jupyter notebooks.

# data[].attributes.body
Understanding, analyzing, and generating text with Python

# data[].attributes.attachment_link.readable_text
Learn both the theory and practical skills needed to go beyond merely understanding the inner workings of NLP, and start creating your own algorithms or models.

From the Foreword by Dr. Arwen Griffioen, Zendesk

Natural Language Processing in Action is your guide to creating machines that understand human language using the power of Python with its ecosystem of packages dedicated to NLP and AI.

Listen to this book in liveAudio! liveAudio integrates a professional voice recording with the book's text, graphics, code, and exercises in Manning's exclusive liveBook online reader. Use the text to search and navigate the audio, or download the audio-only recording for portable offline listening. You can purchase or upgrade to liveAudio here or in liveBook.

# data[].attributes.attachment_link.description
Learn both the theory and practical skills needed to go beyond merely understanding the inner workings of NLP, and start creating your own algorithms or models. From the Foreword by Dr. Arwen Griffioen, Zendesk Natural Language Processing in Action is your guide to creating machines that understand human language using the power of Python with its ecosystem of packages dedicated to NLP and AI.

# data[].attributes.headline
Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow

# data[].attributes.subject
Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow

# data[].attributes.body
link for preview (epub/pdf)

# data[].attributes.attachment_link.title
Hands-On Machine Learning with Scikit-Learn and TensorFlow 2e by Aurelien Geron - PDF Drive

# data[].attributes.headline
NumPy: the absolute basics for beginners

# data[].attributes.subject
NumPy: the absolute basics for beginners

# data[].attributes.attachment_link.readable_text
Welcome to the absolute beginner's guide to NumPy! If you have comments or suggestions, please don't hesitate to reach out!

Welcome to NumPy!

NumPy ( Numerical Python) is an open source Python library that's used in almost every field of science and engineering. It's the universal standard for working with numerical data in Python, and it's at the core of the scientific Python and PyData ecosystems. NumPy users include everyone from beginning coders to experienced researchers doing state-of-the-art scientific and industrial research and development. The NumPy API is used extensively in Pandas, SciPy, Matplotlib, scikit-learn, scikit-image and most other data science and scientific Python packages.

The NumPy library contains multidimensional array and matrix data structures (you'll find more information about this in later sections). It provides ndarray, a homogeneous n-dimensional array object, with methods to efficiently operate on it. NumPy can be used to perform a wide variety of mathematical operations on arrays. It adds powerful data structures to Python that guarantee efficient calculations with arrays and matrices and it supplies an enormous library of high-level mathematical functions that operate on these arrays and matrices.

Learn more about NumPy here !

Installing NumPy

To install NumPy, we strongly recommend using a scientific Python distribution. If you're looking for the full instructions for installing NumPy on your operating system, see Installing NumPy.

If you already have Python, you can install NumPy with:

or

If you don't have Python yet, you might want to consider using Anaconda. It's the easiest way to get started. The good thing about getting this distribution is the fact that you don't need to worry too much about separately installing NumPy or any of the major packages that you'll be using for your data analyses, like pandas, Scikit-Learn, etc.

How to import NumPy

To access NumPy and its functions import it in your Python code like this:

Reading the example code

If you aren't already comfortable with reading tutorials that contain a lot of code, you might not know how to interpret a code block that looks like this:

If you aren't familiar with this style, it's very easy to understand. If you see >>> , you're looking at input, or the code that you would enter. Everything that doesn't have>>> in front of it is output, or the results of running your code. This is the style you see when you run python on the command line, but if you're using IPython, you might see a different style. Note that it is not part of the code and will cause an error if typed or pasted into the Python shell. It can be safely typed or pasted into the IPython shell; the>>> is ignored.

What's the difference between a Python list and a NumPy array?

NumPy gives you an enormous range of fast and efficient ways of creating arrays and manipulating numerical data inside them. While a Python list can contain different data types within a single list, all of the elements in a NumPy array should be homogeneous. The mathematical operations that are meant to be performed on arrays would be extremely inefficient if the arrays weren't homogeneous.
Why use NumPy?
NumPy arrays are faster and more compact than Python lists. An array consumes less memory and is convenient to use. NumPy uses much less memory to store data and it provides a mechanism of specifying the data types. This allows the code to be optimized even further.

What is an array?

An array is a central data structure of the NumPy library. An array is a grid of values and it contains information about the raw data, how to locate an element, and how to interpret an element. It has a grid of elements that can be indexed in various ways . The elements are all of the same type, referred to as the array dtype .

One way we can initialize NumPy arrays is from Python lists, using nested lists for two- or higher-dimensional data.

For example:

or:

We can access the elements in the array using square brackets. When you're accessing elements, remember that indexing in NumPy starts at 0. That means that if you want to access the first element in your array, you'll be accessing element "0".

More information about arrays

This section covers 1D array , 2D array , ndarray , vector , matrix

You might occasionally hear an array referred to as a "ndarray," which is shorthand for "N-dimensional array." An N-dimensional array is simply an array with any number of dimensions. You might also hear 1-D, or one-dimensional array, 2-D, or two-dimensional array, and so on. The NumPy ndarray class is used to represent both matrices and vectors. A vector is an array with a single dimension (there's no difference between row and column vectors), while a matrix refers to an array with two dimensions. For 3-D or higher dimensional arrays, the term tensor is also commonly used.
What are the attributes of an array?
An array is usually a fixed-size container of items of the same type and size. The number of dimensions and items in an array is defined by its shape. The shape of an array is a tuple of non-negative integers that specify the sizes of each dimension.

In NumPy, dimensions are called axes. This means that if you have a 2D array that looks like this:

Your array has 2 axes. The first axis has a length of 2 and the second axis has a length of 3.

Just like in other Python container objects, the contents of an array can be accessed and modified by indexing or slicing the array. Unlike the typical container objects, different arrays can share the same data, so changes made on one array might be visible in another.

Array attributes reflect information intrinsic to the array itself. If you need to get, or even set, properties of an array without creating a new array, you can often access an array through its attributes.

Read more about array attributes here and learn about array objects here .

How to create a basic array

This section covers np.array() , np.zeros() , np.ones() , np.empty() , np.arange() , np.linspace() , dtype

To create a NumPy array, you can use the function np.array() .

All you need to do to create a simple array is pass a list to it. If you choose to, you can also specify the type of data in your list. You can find more information about data types here .

You can visualize your array this way:
Be aware that these visualizations are meant to simplify ideas and give you a basic understanding of NumPy concepts and mechanics. Arrays and array operations are much more complicated than are captured here!
Besides creating an array from a sequence of elements, you can easily create an array filled with 0 's:

Or an array filled with 1 's:

You can create an array with a range of elements:

And even an array that contains a range of evenly spaced intervals. To do this, you will specify the first number, last number, and the step size.

You can also use np.linspace() to create an array with values that are spaced linearly in a specified interval:
Specifying your data type Learn more about creating arrays here

Adding, removing, and sorting elements

This section covers np.sort() , np.concatenate()

Sorting an element is simple with np.sort() . You can specify the axis, kind, and order when you call the function.

If you start with this array:

You can quickly sort the numbers in ascending order with:

In addition to sort, which returns a sorted copy of an array, you can use:

argsort , which is an indirect sort along a specified axis,

lexsort , which is an indirect stable sort on multiple keys,

searchsorted , which will find elements in a sorted array, and

partition , which is a partial sort.

If you start with these arrays:

You can concatenate them with np.concatenate() .

Or, if you start with these arrays:

You can concatenate them with:

In order to remove elements from an array, it's simple to use indexing to select the elements that you want to keep.

How do you know the shape and size of an array?

This section covers ndarray.ndim , ndarray.size , ndarray.shape

ndarray.ndim will tell you the number of axes, or dimensions, of the array.

ndarray.size will tell you the total number of elements of the array. This is the product of the elements of the array's shape.

ndarray.shape will display a tuple of integers that indicate the number of elements stored along each dimension of the array. If, for example, you have a 2-D array with 2 rows and 3 columns, the shape of your array is(2, 3) .

For example, if you create this array:

To find the number of dimensions of the array, run:

To find the total number of elements in the array, run:

And to find the shape of your array, run:

Can you reshape an array?

This section covers arr.reshape()
Yes!
Using arr.reshape() will give a new shape to an array without changing the data. Just remember that when you use the reshape method, the array you want to produce needs to have the same number of elements as the original array. If you start with an array with 12 elements, you'll need to make sure that your new array also has a total of 12 elements.

If you start with this array:

You can use reshape() to reshape your array. For example, you can reshape this array to an array with three rows and two columns:

With np.reshape , you can specify a few optional parameters:

a is the array to be reshaped.

newshape is the new shape you want. You can specify an integer or a tuple of integers. If you specify an integer, the result will be an array of that length. The shape should be compatible with the original shape.

order: C means to read/write the elements using C-like index order, F means to read/write the elements using Fortran-like index order, A means to read/write the elements in Fortran-like index order if a is Fortran contiguous in memory, C-like order otherwise. (This is an optional parameter and doesn't need to be specified.)

If you want to learn more about C and Fortran order, you can read more about the internal organization of NumPy arrays here . Essentially, C and Fortran orders have to do with how indices correspond to the order the array is stored in memory. In Fortran, when moving through the elements of a two-dimensional array as it is stored in memory, the first index is the most rapidly varying index. As the first index moves to the next row as it changes, the matrix is stored one column at a time. This is why Fortran is thought of as a Column-major language. In C on the other hand, the last index changes the most rapidly. The matrix is stored by rows, making it a Row-major language. What you do for C or Fortran depends on whether it's more important to preserve the indexing convention or not reorder the data.

Learn more about shape manipulation here .

How to convert a 1D array into a 2D array (how to add a new axis to an array)

This section covers np.newaxis , np.expand_dims

Using np.newaxis will increase the dimensions of your array by one dimension when used once. This means that a 1D array will become a 2D array, a 2D array will become a 3D array, and so on.

For example, if you start with this array:

You can use np.newaxis to add a new axis:

You can explicitly convert a 1D array with either a row vector or a column vector using np.newaxis . For example, you can convert a 1D array to a row vector by inserting an axis along the first dimension:

Or, for a column vector, you can insert an axis along the second dimension:

You can also expand an array by inserting a new axis at a specified position with np.expand_dims .

For example, if you start with this array:

You can use np.expand_dims to add an axis at index position 1 with:

You can add an axis at index position 0 with:

Find more information about newaxis here and expand_dims at expand_dims .

Indexing and slicing

You can index and slice NumPy arrays in the same ways you can slice Python lists.

You can visualize it this way:

You may want to take a section of your array or specific array elements to use in further analysis or additional operations. To do that, you'll need to subset, slice, and/or index your arrays.

If you want to select values from your array that fulfill certain conditions, it's straightforward with NumPy.

For example, if you start with this array:

You can easily print all of the values in the array that are less than 5.

You can also select, for example, numbers that are equal to or greater than 5, and use that condition to index an array.

You can select elements that are divisible by 2:

You can also make use of the logical operators & and | in order to return boolean values that specify whether or not the values in an array fulfill a certain condition. This can be useful with arrays that contain names or other categorical values.

You can also use np.nonzero() to select elements or indices from an array.

Starting with this array:

You can use np.nonzero() to print the indices of elements that are, for example, less than 5:

In this example, a tuple of arrays was returned: one for each dimension. The first array represents the row indices where these values are found, and the second array represents the column indices where the values are found.

If you want to generate a list of coordinates where the elements exist, you can zip the arrays, iterate over the list of coordinates, and print them. For example:

You can also use np.nonzero() to print the elements in an array that are less than 5 with:

If the element you're looking for doesn't exist in the array, then the returned array of indices will be empty. For example:

Learn more about indexing and slicing here and here .

How to create an array from existing data

This section covers slicing and indexing , np.vstack() , np.hstack() , np.hsplit() , .view() , copy()

You can easily create a new array from a section of an existing array.

Let's say you have this array:

You can create a new array from a section of your array any time by specifying where you want to slice your array.

Here, you grabbed a section of your array from index position 3 through index position 8.

You can stack them vertically with vstack :

Or stack them horizontally with hstack :

You can split an array into several smaller arrays using hsplit . You can specify either the number of equally shaped arrays to return or the columns after which the division should occur.

Let's say you have this array:

If you wanted to split this array into three equally shaped arrays, you would run:

If you wanted to split your array after the third and fourth column, you'd run:

Learn more about stacking and splitting arrays here .

You can use the view method to create a new array object that looks at the same data as the original array (a shallow copy).

Views are an important NumPy concept! NumPy functions, as well as operations like indexing and slicing, will return views whenever possible. This saves memory and is faster (no copy of the data has to be made). However it's important to be aware of this - modifying data in a view also modifies the original array!

Let's say you create this array:

Now we create an array b1 by slicing a and modify the first element of b1 . This will modify the corresponding element in a as well!

Using the copy method will make a complete copy of the array and its data (a deep copy). To use this on your array, you could run:

Learn more about copies and views here .

Basic array operations
This section covers addition, subtraction, multiplication, division, and more
Once you've created your arrays, you can start to work with them. Let's say, for example, that you've created two arrays, one called "data" and one called "ones"

You can add the arrays together with the plus sign.

You can, of course, do more than just addition!

Basic operations are simple with NumPy. If you want to find the sum of the elements in an array, you'd use sum() . This works for 1D arrays, 2D arrays, and arrays in higher dimensions.

To add the rows or the columns in a 2D array, you would specify the axis.

If you start with this array:

You can sum over the axis of rows with:

You can sum over the axis of columns with:

Learn more about basic operations here .

Broadcasting

There are times when you might want to carry out an operation between an array and a single number (also called an operation between a vector and a scalar) or between arrays of two different sizes. For example, your array (we'll call it "data") might contain information about distance in miles but you want to convert the information to kilometers. You can perform this operation with:

NumPy understands that the multiplication should happen with each cell. That concept is called broadcasting. Broadcasting is a mechanism that allows NumPy to perform operations on arrays of different shapes. The dimensions of your array must be compatible, for example, when the dimensions of both arrays are equal or when one of them is 1. If the dimensions are not compatible, you will get a ValueError .

Learn more about broadcasting here .

More useful array operations
This section covers maximum, minimum, sum, mean, product, standard deviation, and more
NumPy also performs aggregation functions. In addition to min , max , and sum , you can easily run mean to get the average, prod to get the result of multiplying the elements together, std to get the standard deviation, and more.

Let's start with this array, called "a"

It's very common to want to aggregate along a row or column. By default, every NumPy aggregation function will return the aggregate of the entire array. To find the sum or the minimum of the elements in your array, run:

Or:

You can specify on which axis you want the aggregation function to be computed. For example, you can find the minimum value within each column by specifying axis=0 .

The four values listed above correspond to the number of columns in your array. With a four-column array, you will get four values as your result.

Read more about array methods here .

Creating matrices

You can pass Python lists of lists to create a 2-D array (or "matrix") to represent them in NumPy.

Indexing and slicing operations are useful when you're manipulating matrices:

You can aggregate matrices the same way you aggregated vectors:

You can aggregate all the values in a matrix and you can aggregate them across columns or rows using the axis parameter. To illustrate this point, let's look at a slightly modified dataset:

Once you've created your matrices, you can add and multiply them using arithmetic operators if you have two matrices that are the same size.

You can do these arithmetic operations on matrices of different sizes, but only if one matrix has only one column or one row. In this case, NumPy will use its broadcast rules for the operation.

Be aware that when NumPy prints N-dimensional arrays, the last axis is looped over the fastest while the first axis is the slowest. For instance:

Read more about creating arrays, filled with 0 's, 1 's, other values or uninitialized, at array creation routines .

Generating random numbers

The use of random number generation is an important part of the configuration and evaluation of many numerical and machine learning algorithms. Whether you need to randomly initialize weights in an artificial neural network, split data into random sets, or randomly shuffle your dataset, being able to generate random numbers (actually, repeatable pseudo-random numbers) is essential.

You can generate a 2 x 4 array of random integers between 0 and 4 with:

Read more about random number generation here .

How to get unique items and counts

This section covers np.unique()

You can find the unique elements in an array easily with np.unique .

For example, if you start with this array:

you can use np.unique to print the unique values in your array:

This also works with 2D arrays! If you start with this array:

You can find unique values with:

If the axis argument isn't passed, your 2D array will be flattened.

To get the unique rows, index position, and occurrence count, you can use:

Transposing and reshaping a matrix

This section covers arr.reshape() , arr.transpose() , arr.T

It's common to need to transpose your matrices. NumPy arrays have the property T that allows you to transpose a matrix.

You may also need to switch the dimensions of a matrix. This can happen when, for example, you have a model that expects a certain input shape that is different from your dataset. This is where the reshape method can be useful. You simply need to pass in the new dimensions that you want for the matrix.

You can also use .transpose() to reverse or change the axes of an array according to the values you specify.

If you start with this array:

You can transpose your array with arr.transpose() .

You can also use arr.T :

>>>  arr . T
array([[0, 3],
       [1, 4],
       [2, 5]])

To learn more about transposing and reshaping arrays, see transpose andreshape .

How to reverse an array

This section covers np.flip()
Reversing a 1D array
If you begin with a 1D array like this one:

You can reverse it with:

If you want to print your reversed array, you can run:
Reversing a 2D array
A 2D array works much the same way.

If you start with this array:

You can reverse the content in all of the rows and all of the columns with:

You can easily reverse only the rows with:

Or reverse only the columns with:

You can also reverse the contents of only one column or row. For example, you can reverse the contents of the row at index position 1 (the second row):

You can also reverse the column at index position 1 (the second column):

Reshaping and flattening multidimensional arrays

This section covers .flatten() , ravel()

There are two popular ways to flatten an array: .flatten() and .ravel() . The primary difference between the two is that the new array created using ravel() is actually a reference to the parent array (i.e., a "view"). This means that any changes to the new array will affect the parent array as well. Since ravel does not create a copy, it's memory efficient.

If you start with this array:

You can use flatten to flatten your array into a 1D array.

When you use flatten , changes to your new array won't change the parent array.

For example:

But when you use ravel , the changes you make to the new array will affect the parent array.

For example:

Read more about flatten at ndarray.flatten and ravel at ravel .

How to access the docstring for more information

This section covers help() , ? , ??

When it comes to the data science ecosystem, Python and NumPy are built with the user in mind. One of the best examples of this is the built-in access to documentation. Every object contains the reference to a string, which is known as the docstring. In most cases, this docstring contains a quick and concise summary of the object and how to use it. Python has a built-in help() function that can help you access this information. This means that nearly any time you need more information, you can use help() to quickly find the information that you need.

For example:

Because access to additional information is so useful, IPython uses the ? character as a shorthand for accessing this documentation along with other relevant information. IPython is a command shell for interactive computing in multiple languages. You can find more information about IPython here.

For example:

You can even use this notation for object methods and objects themselves.

Let's say you create this array:

This also works for functions and other objects that you create. Just remember to include a docstring with your function using a string literal (""" """ or ''' ''' around your documentation).

For example, if you create this function:

You can obtain information about the function:

You can reach another level of information by reading the source code of the object you're interested in. Using a double question mark (?? ) allows you to access the source code.

For example:

and :

have the same output because they were compiled in a programming language other than Python.

Working with mathematical formulas

The ease of implementing mathematical formulas that work on arrays is one of the things that make NumPy so widely used in the scientific Python community.

For example, this is the mean square error formula (a central formula used in supervised machine learning models that deal with regression):

Implementing this formula is simple and straightforward in NumPy:

You can visualize it this way:

In this example, both the predictions and labels vectors contain three values, meaning n has a value of three. After we carry out subtractions the values in the vector are squared. Then NumPy sums the values, and your result is the error value for that prediction and a score for the quality of the model.

How to save and load NumPy objects

This section covers np.save , np.savez , np.savetxt , np.load , np.loadtxt

You will, at some point, want to save your arrays to disk and load them back without having to re-run the code. Fortunately, there are several ways to save and load objects with NumPy. The ndarray objects can be saved to and loaded from the disk files with loadtxt and savetxt functions that handle normal text files, load and save functions that handle NumPy binary files with a.npy file extension, and a savez function that handles NumPy files with a.npz file extension.

The .npy and .npz files store data, shape, dtype, and other information required to reconstruct the ndarray in a way that allows the array to be correctly retrieved, even when the file is on another machine with different architecture.

If you want to store a single ndarray object, store it as a .npy file using np.save . If you want to store more than one ndarray object in a single file, save it as a .npz file using np.savez . You can also save several arrays into a single file in compressed npz format withsavez_compressed .

It's easy to save and load and array with np.save() . Just make sure to specify the array you want to save and a file name. For example, if you create this array:

You can save it as "filename.npy" with:

You can use np.load() to reconstruct your array.

If you want to check your array, you can run:

You can save a NumPy array as a plain text file like a .csv or .txt file with np.savetxt .

For example, if you create this array:

You can easily save it as a .csv file with the name "new_file.csv" like this:

You can quickly and easily load your saved text file using loadtxt() :

The savetxt() and loadtxt() functions accept additional optional parameters such as header, footer, and delimiter. While text files can be easier for sharing, .npy and .npz files are smaller and faster to read. If you need more sophisticated handling of your text file (for example, if you need to work with lines that contain missing values), you will want to use thegenfromtxt function.

Learn more about input and output routines here .

Importing and exporting a CSV

It's simple to read in a CSV that contains existing information. The best and easiest way to do this is to use Pandas.

It's simple to use Pandas in order to export your array as well. If you are new to NumPy, you may want to create a Pandas dataframe from the values in your array and then write the data frame to a CSV file with Pandas.

If you created this array "a"

You could create a Pandas dataframe

You can easily save your dataframe with:

And read your CSV with:

You can also save your array with the NumPy savetxt method.

If you're using the command line, you can read your saved CSV any time with a command such as:

$ cat np.csv
#  1,  2,  3,  4
-2.58,0.43,-1.24,1.60
0.99,1.17,0.94,-0.15
0.77,0.81,-0.95,0.12
0.20,0.35,1.97,0.52

Or you can open the file any time with a text editor!

If you're interested in learning more about Pandas, take a look at the official Pandas documentation. Learn how to install Pandas with the official Pandas installation information.

Plotting arrays with Matplotlib

If you need to generate a plot for your values, it's very simple with Matplotlib.

For example, you may have an array like this one:

If you already have Matplotlib installed, you can import it with:

All you need to do to plot your values is run:

For example, you can plot a 1D array like this:

With Matplotlib, you have access to an enormous number of visualization options.

To read more about Matplotlib and what it can do, take a look at the official documentation. For directions regarding installing Matplotlib, see the official installation section.
Image credits: Jay Alammar http://jalammar.github.io/

# data[].attributes.attachment_link.title
NumPy: the absolute basics for beginners - NumPy v1.26 Manual

# data[].attributes.attachment_link.description
Welcome to the absolute beginner's guide to NumPy! If you have comments or suggestions, please don't hesitate to reach out! NumPy ( Numerical Python) is an open source Python library that's used in almost every field of science and engineering.

# data[].attributes.attachment_link.description
An interactive visualization system designed to help non-experts learn about Convolutional Neural Networks (CNNs).

# data[].attributes.body
Reference book for the module (there is a second edition coming up)

# data[].attributes.headline
The One Hundred Year Study on Artificial Intelligence (AI100)2021 Study Panel Report

# data[].attributes.subject
The One Hundred Year Study on Artificial Intelligence (AI100)2021 Study Panel Report

# data[].attributes.body
https://ai100.stanford.edu/sites/g/files/sbiybj18871/files/media/file/AI100Report_MT_10.pdf

# data[].attributes.body
I know what y'all thinking: maybe it will write the assignment for me?

# data[].attributes.attachment_link.readable_text
Skip to Content

The AI is the largest language model ever created and can generate amazing human-like text on demand but won't bring us closer to true intelligence.

"Playing with GPT-3 feels like seeing the future," Arram Sabeti, a San Francisco-based developer and artist, tweeted last week. That pretty much sums up the response on social media in the last few days to OpenAI's latest language-generating AI.

OpenAI first described GPT-3 in a research paper published in May. But last week it began drip-feeding the software to selected people who requested access to a private beta. For now, OpenAI wants outside developers to help it explore what GPT-3 can do, but it plans to turn the tool into a commercial product later this year, offering businesses a paid-for subscription to the AI via the cloud.

GPT-3 is the most powerful language model ever. Its predecessor, GPT-2, released last year, was already able to spit out convincing streams of text in a range of different styles when prompted with an opening sentence. But GPT-3 is a big leap forward. The model has 175 billion parameters (the values that a neural network tries to optimize during training), compared with GPT-2's already vast 1.5 billion. And with language models, size really does matter.

Sabeti linked to a blog post where he showed off short stories, songs, press releases, technical manuals, and more that he had used the AI to generate. GPT-3 can also produce pastiches of particular writers. Mario Klingemann, an artist who works with machine learning, shared a short story called "The importance of being on Twitter," written in the style of Jerome K. Jerome, which starts: "It is a curious fact that the last remaining form of social life in which the people of London are still interested is Twitter. I was struck with this curious fact when I went on one of my periodical holidays to the sea-side, and found the whole place twittering like a starling-cage." Klingemann says all he gave the AI was the title, the author's name and the initial "It." There is even a reasonably informative article about GPT-3 written entirely by GPT-3.

Others have found that GPT-3 can generate any kind of text, including guitar tabs or computer code. For example, by tweaking GPT-3 so that it produced HTML rather than natural language, web developer Sharif Shameem showed that he could make it create web-page layouts by giving it prompts like "a button that looks like a watermelon" or "large text in red that says WELCOME TO MY NEWSLETTER and a blue button that says Subscribe." Even legendary coder John Carmack, who pioneered 3D computer graphics in early video games like Doom and is now consulting CTO at Oculus VR, was unnerved: "The recent, almost accidental, discovery that GPT-3 can sort of write code does generate a slight shiver."

Yet despite its new tricks, GPT-3 is still prone to spewing hateful sexist and racist language. Fine-tuning the model helped limit this kind of output in GPT-2.

It's also no surprise that many have been quick to start talking about intelligence. But GPT-3's human-like output and striking versatility are the results of excellent engineering, not genuine smarts. For one thing, the AI still makes ridiculous howlers that reveal a total lack of common sense. But even its successes have a lack of depth to them, reading more like cut-and-paste jobs than original compositions.

Exactly what's going on inside GPT-3 isn't clear. But what it seems to be good at is synthesizing text it has found elsewhere on the internet, making it a kind of vast, eclectic scrapbook created from millions and millions of snippets of text that it then glues together in weird and wonderful ways on demand.

That's not to downplay OpenAI's achievement. And a tool like this has many new uses, both good (from powering better chatbots to helping people code) and bad (from powering better misinformation bots to helping kids cheat on their homework).

But when a new AI milestone comes along it too often gets buried in hype. Even Sam Altman, who co-founded OpenAI with Elon Musk, tried to tone things down: "The GPT-3 hype is way too much. It's impressive (thanks for the nice compliments!) but it still has serious weaknesses and sometimes makes very silly mistakes. AI is going to change the world, but GPT-3 is just a very early glimpse. We have a lot still to figure out."

We have a low bar when it comes to spotting intelligence. If something looks smart, it's easy to kid ourselves that it is. The greatest trick AI ever pulled was convincing the world it exists. GPT-3 is a huge leap forward-but it is still a tool made by humans, with all the flaws and limitations that implies.

Deep Dive

Artificial intelligence

Exclusive conversations that take us behind the scenes of a cultural phenomenon.

New large language models will transform many jobs. Whether they will lead to widespread prosperity or not is up to us.

We got a first look at the much-anticipated big new language model from OpenAI. But this time how it works is even more deeply under wraps.

The narrative around cheating students doesn't tell the whole story. Meet the teachers who think generative AI could actually make learning better.

Stay connected

Illustration by Rose Wong

Get the latest updates from
MIT Technology Review

Discover special offers, top stories, upcoming events, and more.

# data[].attributes.attachment_link.title
OpenAI's new language generator GPT-3 is shockingly good-and completely mindless

# data[].attributes.attachment_link.description
"Playing with GPT-3 feels like seeing the future," Arram Sabeti, a San Francisco-based developer and artist, tweeted last week. That pretty much sums up the response on social media in the last few days to OpenAI's latest language-generating AI. OpenAI first described GPT-3 in a research paper published in May.

# data[].attributes.headline
MIT 6.S191 Introduction to Deep Learning

# data[].attributes.subject
MIT 6.S191 Introduction to Deep Learning

# data[].attributes.attachment_link.readable_text
Course Description

MIT's introductory course on deep learning methods with applications to computer vision, natural language processing, biology, and more! Students will gain foundational knowledge of deep learning algorithms and get practical experience in building neural networks in TensorFlow. Course concludes with a project proposal competition with feedback from staff and panel of industry sponsors. Prerequisites assume calculus (i.e. taking derivatives) and linear algebra (i.e. matrix multiplication), we'll try to explain everything else along the way! Experience in Python is helpful but not necessary. Listeners are welcome!

# data[].attributes.attachment_link.description
MIT's introductory course on deep learning methods with applications to computer vision, natural language processing, biology, and more! Students will gain foundational knowledge of deep learning algorithms and get practical experience in building neural networks in TensorFlow. Course concludes with a project proposal competition with feedback from staff and panel of industry sponsors.

# data[].attributes.body
my own project with a company based in Wellingborough

# data[].attributes.attachment_link.readable_text
In Part 4, I made a start with establishing a new training dataset by harvesting publicly accessible photos on social media. The main benefit of using user generated content is that they were taken in a real-world setting, hence close to what the targeting logos would look like in a film. For content selection and labelling, my own filtering tool and Yolo_Mark worked pretty well. It wasn't easy to label 600+ images but the workflow is decent. The three classes are: 0 - Cadbury, 1 - ROSES, and 2 - HEROES. There are some typeface variations of ROSES. You need to be patient and consistent of the labelling strategy. As humans, we are able to acquire information from different sources very quickly while making a decision. So if I were actively looking for a particular logo while knowing the logo is definitely present, I could still point at an unidentifiable blob of pixels and be 100% certain that its a Cadbury logo on a discarded purple wrapper. It may not be realistic to expect a "low-level" machine learning model with a small training set to capture what human could do in this case. Therefore I limit the labelling to only the logos that I could visually identify directly.

Labelling a photo using Yolo_mark (Image copyrights belong to its owner)

The training process wasn't much different from the previous modelling for Coca-cola logo except some further tidying of the dataset (minor issues with missing files, etc.). With a baseline configuration, it took about 6 hours to complete 6000 epochs with a pretty good result base on the detection of three logos.

The images below illustrate what the model picks up from some standard photos (using the slider to see "before" and "after").

logo detection

Another example:

logo detection

I've also tested the model on some videos provided by our partner. I won't be able to show it here due to copyrights but its safe to say that it works very well with room for improvements. Some adjustment can be done at the modelling side, such as increasing the size of training images (currently downsampled to 608×608), increasing the number of detection layers to accommodate a larger range of logo sizes, or perhaps giving the new YOLOv4 a go!

This update concludes the "Product detection in movies and TV shows using machine learning" series. The dataset used for Cadbury, Roses, and Heroes training will be made public for anyone interested in giving it a go or expanding her own logo detector. I am still pushing this topic forward and will start a new series soon!
Product detection in movies and TV shows using machine learning - part 1: Background Product detection in movies and TV shows using machine learning - part 2: Dataset and implementations Product detection in movies and TV shows using machine learning - part 3: Training and Results Product detection in movies and TV shows using machine learning - part 4: Start a new dataset

# data[].attributes.attachment_link.title
Product detection in movies and TV shows using machine learning - part 5: Finding sweeties quick

# data[].attributes.attachment_link.description
In Part 4, I made a start with establishing a new training dataset by harvesting publicly accessible photos on social media. The main benefit of using user generated content is that they were taken in a real-world setting, hence close to what the targeting logos would look like in a film.

# data[].attributes.body
how to accommodate multiple learning processes.

# data[].attributes.attachment_link.title
PyTorch at Tesla - Andrej Karpathy, Tesla

# data[].attributes.headline
A deep learning/VR art research by the UoN team.

# data[].attributes.subject
A deep learning/VR art research by the UoN team.

# data[].attributes.body
it's awesome because we used the code from this class.

# data[].attributes.attachment_link.title
User Attention and Behaviour in Virtual Reality Art Encounter

# data[].attributes.attachment_link.description
With the proliferation of consumer virtual reality (VR) headsets and creative tools, content creators have started to experiment with new forms of interactive audience experience using immersive media. Understanding user attention and behaviours in virtual environment can greatly inform creative processes in VR.

# data[].attributes.attachment_link.readable_text
Your browser does not support the video tag.

I encourage my team to keep learning. Ideas in different topics or fields can often inspire new ideas and broaden the potential solution space.

Lilian Weng Applied AI at OpenAI

# data[].attributes.attachment_link.description
Creating safe AGI that benefits all of humanity

# data[].attributes.body
if you are looking for inspirations