PyTorch Tutorial
Selected Reading
- PyTorch - Discussion
- PyTorch - Useful Resources
- PyTorch - Quick Guide
- PyTorch - Recursive Neural Networks
- PyTorch - Word Embedding
- Sequence Processing with Convents
- PyTorch - Visualization of Convents
- PyTorch - Feature Extraction in Convents
- Training a Convent from Scratch
- PyTorch - Introduction to Convents
- PyTorch - Datasets
- PyTorch - Recurrent Neural Network
- PyTorch - Convolutional Neural Network
- PyTorch - Linear Regression
- PyTorch - Loading Data
- PyTorch - Terminologies
- Neural Networks to Functional Blocks
- Implementing First Neural Network
- Machine Learning vs. Deep Learning
- Universal Workflow of Machine Learning
- PyTorch - Neural Network Basics
- Mathematical Building Blocks of Neural Networks
- PyTorch - Installation
- PyTorch - Introduction
- PyTorch - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
PyTorch - Visualization of Convents
PyTorch - Visuapzation of Convents
In this chapter, we will be focusing on the data visuapzation model with the help of convents. Following steps are required to get a perfect picture of visuapzation with conventional neural network.
Step 1
Import the necessary modules which is important for the visuapzation of conventional neural networks.
import os import numpy as np import pandas as pd from scipy.misc import imread from sklearn.metrics import accuracy_score import keras from keras.models import Sequential, Model from keras.layers import Dense, Dropout, Flatten, Activation, Input from keras.layers import Conv2D, MaxPoopng2D import torch
Step 2
To stop potential randomness with training and testing data, call the respective data set as given in the code below −
seed = 128 rng = np.random.RandomState(seed) data_dir = "../../datasets/MNIST" train = pd.read_csv( ../../datasets/MNIST/train.csv ) test = pd.read_csv( ../../datasets/MNIST/Test_fCbTej3.csv ) img_name = rng.choice(train.filename) filepath = os.path.join(data_dir, train , img_name) img = imread(filepath, flatten=True)
Step 3
Plot the necessary images to get the training and testing data defined in perfect way using the below code −
pylab.imshow(img, cmap = gray ) pylab.axis( off ) pylab.show()
The output is displayed as below −
Advertisements