Create things on GPU Consider these two lines: torch.zeros(100, device="gpu") torch.zeros(100).to("cuda") They should effect the same, but first one is faster as it assumes creating GPU tensor directly without copy from CPU, while the second one uses the copy from CPU trick. Two different loss functions If you have two different loss functions, finish the forwards for … [Read more...] about PyTorch healthier life

# ai

## Experiment in TensorFlow

Here is the task: An experimental drug was tested on individuals from 13 to 100. The trail had 2100 participants. Half were under 65 years old, half were over 65 years old. 95% of patients 65 or older experianced no side effects. 95% of patients under 65 experianced no side effects. import numpy as np from random import randint mport keras from keras import backend as … [Read more...] about Experiment in TensorFlow

## MNIST dataset classification problem

What would be the "Hello World" problem in Ai? Some would say this would be Spam Filtering using Naive Bayesian Classifier, but many would take the MNIST dataset representing the model containing 60.000 different ciphers 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9. This is also known as the MNIST dataset classification problem. To work on this problem using TensorFlow it would be enough … [Read more...] about MNIST dataset classification problem