Wednesday, April 14, 2021
  • Setup menu at Appearance » Menus and assign menu to Top Bar Navigation
Advertisement
  • AI Development
    • Artificial Intelligence
    • Machine Learning
    • Neural Networks
    • Learn to Code
  • Data
    • Blockchain
    • Big Data
    • Data Science
  • IT Security
    • Internet Privacy
    • Internet Security
  • Marketing
    • Digital Marketing
    • Marketing Technology
  • Technology Companies
  • Crypto News
No Result
View All Result
NikolaNews
  • AI Development
    • Artificial Intelligence
    • Machine Learning
    • Neural Networks
    • Learn to Code
  • Data
    • Blockchain
    • Big Data
    • Data Science
  • IT Security
    • Internet Privacy
    • Internet Security
  • Marketing
    • Digital Marketing
    • Marketing Technology
  • Technology Companies
  • Crypto News
No Result
View All Result
NikolaNews
No Result
View All Result
Home Neural Networks

Using Variational Autoencoder (VAE) to Generate New Images | by Muhammad Ardi | Oct, 2020

October 19, 2020
in Neural Networks
Using Variational Autoencoder (VAE) to Generate New Images | by Muhammad Ardi | Oct, 2020
586
SHARES
3.3k
VIEWS
Share on FacebookShare on Twitter

The digit images itself can be downloaded through Keras API — you might have noticed this when we imported the libraries. After running the code below all images are going to be stored in X_train and X_test, while the ground truths (or labels) are stored in both y arrays.

(X_train, y_train), (X_test, y_test) = mnist.load_data()

Now if you wanna see how the images look like, we can just run the following code. Here I decided to show images at index 120 to 129 taken from X_train array. The output should look something like the image that I showed earlier.

You might also like

How to Enter Your First Zindi Competition | by Davis David

Why I Think That Avengers: Age of Ultron is One of the Best Sci-Fi Movies About A.I | by Brighton Nkomo | Apr, 2021

Music and Artificial Intelligence | by Ryan M. Raiker, MBA | Apr, 2021

1. Fundamentals of AI, ML and Deep Learning for Product Managers

2. The Unfortunate Power of Deep Learning

3. Graph Neural Network for 3D Object Detection in a Point Cloud

4. Know the biggest Notable difference between AI vs. Machine Learning

fig, axes = plt.subplots(ncols=10, sharex=False,
sharey=True, figsize=(20, 7))
counter = 0
for i in range(120, 130):
axes[counter].set_title(y_train[i])
axes[counter].imshow(X_train[i], cmap='gray')
axes[counter].get_xaxis().set_visible(False)
axes[counter].get_yaxis().set_visible(False)
counter += 1
plt.show()

Well, so far we haven’t actually doing any kind of preprocessing stuff. The first thing to do now is to normalize the values which represent the brightness of each pixels, such that those numbers are going to lie within the range of 0 to 1 instead of 0 to 255. It can simply be achieved by dividing all elements in the array by 255 like this:

X_train = X_train/255
X_test = X_test/255

Next, what we need to do now is to reshape both X_train and X_test. Initially, if we check the shape of the two arrays, it’s going to be (60000, 28, 28) and (10000, 28, 28) respectively.

The shape represents (no_of_samples, height, width).

In fact, we need to reshape them all such that there will be a new axis which represents a single color channel as we are going to employ convolution layer (Conv2D layer — we’ll get into it later) in our VAE network. Therefore, we need to apply reshape() method to do so. Notice that I add number 1 (written in bold) at the end of each line.

# Convert from (no_of_data, 28, 28) to (no_of_data, 28, 28, 1)X_train_new = X_train.reshape(X_train.shape[0], X_train.shape[1], X_train.shape[2], 1)X_test_new = X_test.reshape(X_test.shape[0], X_test.shape[1], X_test.shape[2], 1)

After running the code above, the shape of our X data should now look like this:

The new shape of our X data (no_of_samples, height, width, no_of_color_channels).

That’s pretty much all of the preprocessing stage. In the next step we are going to construct the VAE architecture.

Credit: BecomingHuman By: Muhammad Ardi

Previous Post

How marketers can be more efficient with their data and operations

Next Post

Research to bring more secure software for autonomous battlefield operations

Related Posts

How to Enter Your First Zindi Competition | by Davis David
Neural Networks

How to Enter Your First Zindi Competition | by Davis David

April 14, 2021
Why I Think That Avengers: Age of Ultron is One of the Best Sci-Fi Movies About A.I | by Brighton Nkomo | Apr, 2021
Neural Networks

Why I Think That Avengers: Age of Ultron is One of the Best Sci-Fi Movies About A.I | by Brighton Nkomo | Apr, 2021

April 14, 2021
Music and Artificial Intelligence | by Ryan M. Raiker, MBA | Apr, 2021
Neural Networks

Music and Artificial Intelligence | by Ryan M. Raiker, MBA | Apr, 2021

April 13, 2021
BERT Transformers — How Do They Work? | by James Montantes | Apr, 2021
Neural Networks

BERT Transformers — How Do They Work? | by James Montantes | Apr, 2021

April 13, 2021
Learning Not To Fear Machine Learning | by Dimitry Belozersky | Apr, 2021
Neural Networks

Learning Not To Fear Machine Learning | by Dimitry Belozersky | Apr, 2021

April 13, 2021
Next Post

Research to bring more secure software for autonomous battlefield operations

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recommended

Plasticity in Deep Learning: Dynamic Adaptations for AI Self-Driving Cars

Plasticity in Deep Learning: Dynamic Adaptations for AI Self-Driving Cars

January 6, 2019
Microsoft, Google Use Artificial Intelligence to Fight Hackers

Microsoft, Google Use Artificial Intelligence to Fight Hackers

January 6, 2019

Categories

  • Artificial Intelligence
  • Big Data
  • Blockchain
  • Crypto News
  • Data Science
  • Digital Marketing
  • Internet Privacy
  • Internet Security
  • Learn to Code
  • Machine Learning
  • Marketing Technology
  • Neural Networks
  • Technology Companies

Don't miss it

Four Tips for Better Videos Ads on LinkedIn [Infographic]
Marketing Technology

Four Tips for Better Videos Ads on LinkedIn [Infographic]

April 14, 2021
‘FLoC off!’ Vivaldi declares as it says no to Google’s tracking system
Internet Security

‘FLoC off!’ Vivaldi declares as it says no to Google’s tracking system

April 14, 2021
Applying artificial intelligence to science education — ScienceDaily
Machine Learning

Machine learning can help slow down future pandemics — ScienceDaily

April 14, 2021
B2B Marketers’ vs. Visitors’ Top Website Features
Marketing Technology

B2B Marketers’ vs. Visitors’ Top Website Features

April 14, 2021
Microsoft April patch download covers 114 CVEs including new Exchange Server bugs
Internet Security

Microsoft April patch download covers 114 CVEs including new Exchange Server bugs

April 14, 2021
RCE Exploit Released for Unpatched Chrome, Opera, and Brave Browsers
Internet Privacy

RCE Exploit Released for Unpatched Chrome, Opera, and Brave Browsers

April 14, 2021
NikolaNews

NikolaNews.com is an online News Portal which aims to share news about blockchain, AI, Big Data, and Data Privacy and more!

What’s New Here?

  • Four Tips for Better Videos Ads on LinkedIn [Infographic] April 14, 2021
  • ‘FLoC off!’ Vivaldi declares as it says no to Google’s tracking system April 14, 2021
  • Machine learning can help slow down future pandemics — ScienceDaily April 14, 2021
  • B2B Marketers’ vs. Visitors’ Top Website Features April 14, 2021

Subscribe to get more!

© 2019 NikolaNews.com - Global Tech Updates

No Result
View All Result
  • AI Development
    • Artificial Intelligence
    • Machine Learning
    • Neural Networks
    • Learn to Code
  • Data
    • Blockchain
    • Big Data
    • Data Science
  • IT Security
    • Internet Privacy
    • Internet Security
  • Marketing
    • Digital Marketing
    • Marketing Technology
  • Technology Companies
  • Crypto News

© 2019 NikolaNews.com - Global Tech Updates