1D Tensor:
tensor([1., 2., 3.])
2D Tensor:
tensor([[0., 0., 0.],
[0., 0., 0.],
[0., 0., 0.]])
Element Wise Addition of a & b:
tensor([4., 6.])
Matrix Multiplication of a & b:
tensor([[3., 4.],
[6., 8.]])
Reshaping
tensor([[ 1, 2],
[ 3, 4],
[ 5, 6],
[ 7, 8],
[ 9, 10],
[11, 12]])
Resizing
tensor([[ 1, 2, 3, 4, 5, 6],
[ 7, 8, 9, 10, 11, 12]])
Transposing
tensor([[ 1, 5, 9],
[ 2, 6, 10],
[ 3, 7, 11],
[ 4, 8, 12]])
NeuralNetwork(
(fc1): Linear(in_features=10, out_features=16, bias=True)
(fc2): Linear(in_features=16, out_features=8, bias=True)
(fc3): Linear(in_features=8, out_features=1, bias=True)
)
Epoch [5/20], Loss: 0.7014
Epoch [10/20], Loss: 0.6906
Epoch [15/20], Loss: 0.6744
Epoch [20/20], Loss: 0.6483