- The
.to()method is versatile and widely used for type conversion and device migration. - It allows you to change both the data type and the device (CPU/GPU) in a single line.
tensor.to(device='cuda', dtype=torch.float32)mypackage/
βββ __init__.py
βββ __main__.py__init__.py file), and it is executed as the main program (using python -m ), the __main__.py file in that package is executed.| class AttrTest: | |
| classAttr = "I'm a class attr" | |
| obj1 = AttrTest() | |
| obj2 = AttrTest() | |
| print(f"before changing by through the class: obj1: {obj1.classAttr} and obj2: {obj2.classAttr}") | |
| AttrTest.classAttr = "Modified via the class" |
π¦ Source
batch_size = 32 # how many independent sequences will we process in parallelπͺΆ Source: HuggingFace course
Deep Q-Learning uses a deep neural network to approximate the different Q-values for each possible action at a state (value-function estimation).
In Deep Q-Learning, we create a loss function that compares our Q-value prediction and the Q-target and uses gradient descent to update the weights of our Deep Q-Network to approximate our Q-values better.
πͺΆ Source: HuggingFace course
πͺΆ Source: HuggingFace course
πͺΆ Source: HuggingFace course
Q-Learning is an off-policy value-based method that uses a TD approach to train its action-value function
π Source: Google ML
πͺΆ Source: HuggingFace course
Monte Carlo: