2 Ways to Measure the Code Execution Time in Google Colab

November 2, 2021 Pennywise

This short and straight-to-the-point article shows you two different ways to measure the execution time of a piece of Python code in Google Colab. Using %timeit The %timeit magic function (function with a prefix is a…

How to Install Python Libraries in Google Colab

October 31, 2021 A Goodman

When using Google Colab, you can install a Python library by running the following: If you want to work with a specific version of a package: In case you wish to upgrade a module to the…

Tensorflow 2 – How to Reverse a Tensor

September 13, 2021 The Plumber

The examples below show you a couple of different ways to reverse a tensor in Tensorflow 2. Using the tf.reverse() function The tf.reverse() function can be used to flip specific dimensions of a tensor. Example: Output:…

Tensorflow 2 – How to Print only the Value of a Tensor

September 13, 2021 The Plumber

This concise post shows you 2 ways to print only the value of a tensor in Tensorflow 2. Using the tf.print() function Example: Output: Using the print() function will result in the following: Reference: https://www.tensorflow.org/api_docs/python/tf/print Using…

Tensorflow 2 – Aggregation Operators on Tensors

August 30, 2021 A Goodman

In simple words, aggregating means condensing the from multiple values down to a smaller amount of values. You can find a more formal definition in the Cambridge dictionary or Merriam Webster dictionary. This article shows you…

Tensorflow 2 – Arithmetic Operations on Tensors

August 24, 2021 Guest Contributor

This guide shows you how to perform the four arithmetic operations on tensors in Tensorflow 2: addition, subtraction, multiplication, and division. Addition You can add values to a tensor using the Python math addition operator or…

2 Ways to Expand a Tensor in Tensorflow 2

August 24, 2021 A Goodman

Expanding a tensor means adding a dimension (or an axis) to it. The two examples below show you two different ways to expand a tenor in Tensorflow 2. Example 1: Using tf.newaxis The code: Output: Example…

3 Ways to Create Random Tensors in Tensorflow 2

August 23, 2021 Guest Contributor

This article shows you a couple of different ways to create random tensors with Tensorflow 2. Using tf.random.Generator Example: Output: Shuffling the Order of Elements in a Tensor Another technique to produce a random tensor is…

Tensorflow – Converting Tensors to Numpy Arrays

August 17, 2021 A Goodman

You can convert a tensor to a numpy array with ease by using the tensor.numpy() method or the np.array() function. Example: Output: Hope this helps!

Tensorflow 2: Convert Arrays to Tensors (2 Examples)

August 17, 2021 A Goodman

A tensor is a multi-dimensional array with a uniform type. It is the standard data format used in Tensorflow. Below are a few examples of creating tensors from Numpy arrays by using tf.convert_to_tensor and tf.constant functions….

Useful Settings for Google Colab You Should Know

May 19, 2021 A Goodman

This article will introduce you to some useful tips when writing and running code on Google Colab. Your work and research will be a little faster, a little more comfortable, a little more pleasant. Dark Mode…

Most Popular Deep Learning Frameworks (2022)

January 1, 2022 Guest Contributor

It is difficult to determine which is the best among deep learning frameworks because each has its own strengths in different scenarios. However, it is quite possible to know which deep learning frameworks are trendy and…

1 2 3 4