Skip to main content

Posts

PyTorch Code for Simple Neural Networks for MNIST Dataset

PyTorch Introduction To Install PyTorch in Linux (Ubuntu), here is the step: $ sudo apt install python3-pip python3 python3-dev $ pip3 install torch torchvision torchaudio notebook MNIST Dataset (0 to 9 handwritten characters) as given below MNIST Dataset Given the dataset of MNIST, do the accuracy analysis of the dataset based on the following hyperparameters using Deep Learning with PyTorch 1. Number of epochs is 4,5,6 and 7 2. batch_size is 64 and 128 3. Number of Hidden layers is 1 and 2 4. Learning rate is 0.001, 0.002 and 0.003 Compute the accuracy in each case. Run the following code either using the Jupyter Notebook or Google Colab . To run the notebook, the command is  $ python3 -m notebook import torch import torch.nn as nn import torch.optim as optim from torch.utils.data import DataLoader, TensorDataset from torchvision import datasets, transforms from torch.autograd import Variable # Define a simple neural network model class SimpleNN(nn.Module): def __init__(self, i...

VLAN implementation using NS2

VLAN implementation using NS2 HARDWARE / SOFTWARE REQUIRED: Network Simulator-2 Operating System – LINUX ( UBUNTU ) THEORY VLAN  is a custom network that is created from one or more local area networks. It enables a group of devices available in multiple networks to be combined into one logical network. The result becomes a virtual LAN that is administered like a physical LAN. The full form of VLAN is defined as Virtual Local Area Network. The below topology depicts a network having all hosts inside the same virtual LAN: Without VLANs, a broadcast sent from a host can easily reach all network devices. Each and every device will process broadcast received frames. It can increase the CPU overhead on each device and reduce the overall network security. In case if you place interfaces on both switches into separate VLANs, a broadcast from host A can reach only devices available inside the same VLAN. Hosts of VLANs will not even be aware that the communication took place. This is shown ...

HTTP and FTP Simulation in NS2

HTTP and FTP Simulation in NS2 HARDWARE / SOFTWARE REQUIRED: Network Simulator-2 Operating System – LINUX ( UBUNTU ) THEORY: HTTP: HTTP stands for  Hypertext Transfer Protocol . It is a protocol used to access the data on the World Wide Web (www). The HTTP protocol can be used to transfer the data in the form of plain text, hypertext, audio, video, and so on. This protocol is known as HyperText Transfer Protocol because of its efficiency which allows us to use it in a hypertext environment where there are rapid jumps from one document to another document. HTTP is similar to FTP as it also transfers files from one host to another host. However, HTTP is simpler than FTP as HTTP uses only one connection, i.e., no control connection to transfer the files. HTTP is used to carry the data in the form of a MIME-like format. Features of HTTP: Connectionless protocol:  HTTP is a connectionless protocol. HTTP client initiates a request and waits for a response from the server. When the s...