PyTorch VM by Anarion Technologies
PyTorch is an open-source machine learning library developed by Facebook’s AI Research lab. It is designed to provide a seamless and efficient framework for developing and training deep learning models. PyTorch excels in enabling researchers and developers to experiment with complex neural network architectures due to its dynamic computational graph, which allows for real-time adjustments and fine-tuning during model training. This feature stands in contrast to static graphs, offering greater flexibility and ease in debugging and experimenting with different model configurations.
The library is highly valued for its strong integration with Python, which simplifies the process of building and deploying machine learning models. PyTorch supports a wide range of functionalities, including tensor computation, automatic differentiation, and a comprehensive set of tools for deep learning. Its modular design and extensive ecosystem of libraries make it suitable for a variety of applications, from computer vision and natural language processing to reinforcement learning.
PyTorch has gained significant popularity within the research community for its user-friendly interface and dynamic nature, which aligns well with the iterative and experimental approaches often employed in cutting-edge research. Additionally, its robust community support and continuous development contribute to its evolution as a leading tool in the field of machine learning and artificial intelligence.
To subscribe to this product from Azure Marketplace and initiate an instance using the Azure compute service, follow these steps:
1. Navigate to Azure Marketplace and subscribe to the desired product.
2. Search for “virtual machines” and select “Virtual machines” under Services.
3. Click on “Add” in the Virtual machines page, which will lead you to the Create a virtual machine page.
4. In the Basics tab:
- Ensure the correct subscription is chosen under Project details.
- Opt for creating a new resource group by selecting “Create new resource group” and name it as “myResourceGroup.”
5. Under Instance details:
- Enter “myVM” as the Virtual machine name.
- Choose “East US” as the Region.
- Select “Ubuntu 18.04 LTS” as the Image.
- Leave other settings as default.
6. For Administrator account:
- Pick “SSH public key.”
- Provide your user name and paste your public key, ensuring no leading or trailing white spaces.
7. Under Inbound port rules > Public inbound ports:
- Choose “Allow selected ports.”
- Select “SSH (22)” and “HTTP (80)” from the drop-down.
8. Keep the remaining settings at their defaults and click on “Review + create” at the bottom of the page.
9. The “Create a virtual machine” page will display the details of the VM you’re about to create. Once ready, click on “Create.”
10. The deployment process will take a few minutes. Once it’s finished, proceed to the next section.
To connect to the virtual machine:
1. Access the overview page of your VM and click on “Connect.”
2. On the “Connect to virtual machine” page:
- Keep the default options for connecting via IP address over port 22.
- A connection command for logging in will be displayed. Click the button to copy the command. Here’s an example of what the SSH connection command looks like:
“`
ssh [email protected]
“`
3. Using the same bash shell that you used to generate your SSH key pair, you can either reopen the Cloud Shell by selecting >_ again
or going to https://shell.azure.com/bash.
4. Paste the SSH connection command into the shell to initiate an SSH session.
Usage/Deployment Instructions
Anarion Technologies – PyTorch
Note: Search product on Azure marketplace and click on “Get it now”
Click on Continue
Click on Create
Creating a virtual machine, enter or select appropriate values for zone, machine type, resource group and so on as per your choice.
After Process of Create Virtual Machine. You have got an Option Go to Resource Group Click Go to Resource Group After Process of
Create Virtual Machine. You have got an Option Go to Resource Group
Click Go to Resource Group
Copy the Public IP Address
SSH into your Terminal and run these following commands:
Open a Terminal: Launch a terminal window.
Start Python Interpreter: Type python3
or python
and press
Enter. This will open the Python interactive shell.
$ python3
You should see a prompt like >>>`
Run the Code: Copy and paste the following code into the interpreter:
import torch
print(“PyTorch version:”, torch.__version__)
# Create a tensor
x = torch.tensor([1.0, 2.0, 3.0])
print(“Tensor:”, x)
# Perform a simple operation
y = x + 2
print(“Tensor after addition:”, y)
# Check if CUDA (GPU support) is available
if torch.cuda.is_available():
print(“CUDA is available. PyTorch can use GPU.”)
else:
print(“CUDA is not available. PyTorch will use CPU.”)
Exit the Interpreter: Type exit()
and press Enter to exit the Python interpreter.