Advertisement
MrPinzon

pytorch_example_1.py

May 23rd, 2022
668
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import numpy as np
  2. import torch
  3.  
  4. # Input (temp, rainfall, humidity)
  5. inputs = np.array([[73, 67, 43],
  6.                    [91, 88, 64],
  7.                    [87, 134, 58],
  8.                    [102, 43, 37],
  9.                    [69, 96, 70]], dtype='float32')
  10.  
  11. # Targets (apples, oranges)
  12. targets = np.array([[56, 70],
  13.                     [81, 101],
  14.                     [119, 133],
  15.                     [22, 37],
  16.                     [103, 119]], dtype='float32')
  17.  
  18. # Convert inputs and targets to tensors
  19. inputs = torch.from_numpy(inputs)
  20. targets = torch.from_numpy(targets)
  21. print(inputs)
  22. print(targets)
Advertisement
RAW Paste Data Copied
Advertisement