A guide to maintaining a linear project history using git rebase and bringing in changes from main into feature_branch
git checkout main
git pull origin mainuv init dir_name will create a new python project
uv init . in an existing project directoryuv run script.py will run script.py. No need to activate venv, uv will take care of ituv add lib_name will pull lib_name from pypi and add it to projectuv remove lib_name will remove lib_name from the envuv lock will generate a lockfileuv sync will make the venv in sync with lockfile, installing and removing as requireduv pip install -r requirements.txt in an existing project directory| import torch | |
| import numpy as np | |
| def check_gpu_capabilities(): | |
| print("=== GPU Information ===") | |
| if not torch.cuda.is_available(): | |
| print("❌ CUDA is not available on this system") | |
| return | |
| Aspect | On-Policy | Off-Policy |
|---|---|---|
| Definition | Learns the value function for the policy being used for action selection | Can learn about a different policy than the one being used for action selection |
| Policy Updating | Uses the same policy for both learning and action selection | Can use different policies for learning and action selection |
| Data Collection | Collects data using the current policy | Can use data collected from any policy |
| Exploration | Typically requires a balance between exploration and exploitation | Can learn from data collected u |
| [shell] | |
| program = "wsl" | |
| args = [ "~" ] | |
| [font] | |
| size = 12 | |
| [font.normal] | |
| family = "CodeNewRoman Nerd Font" | |
| style = "Regular" |
In order to check similarity between 2 vectors, we can check the distance between them. There are a few different metrics to measure distance between 2 vectors.
import numpy as npMeasures the angle between 2 non-zero vectors. It ranges between
def cosine_similarity(p, q):Ctrl + X kill active processCtrl + D exit active shellCtrl + L clear screenCtrl + Z put current process in background (fg to bring it back to foregorund)Ctrl + A to go to front of a lineCtrl + E to go the end of a lineCtrl + F to go forward one character (right arrow)Ctrl + B to go backward one character (left arrow)Alt + F to go forward one word (vim w motion)Alt + B to go backward one word (vim b motion)