uv init dir_namewill create a new python projectuv init .in an existing project directory
uv run script.pywill runscript.py. No need to activate venv, uv will take care of ituv add lib_namewill pulllib_namefrom pypi and add it to projectuv remove lib_namewill removelib_namefrom the envuv lockwill generate a lockfileuv syncwill make the venv in sync with lockfile, installing and removing as requireduv pip install -r requirements.txtin an existing project directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [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 + Xkill active processCtrl + Dexit active shellCtrl + Lclear screenCtrl + Zput current process in background (fgto bring it back to foregorund)Ctrl + Ato go to front of a lineCtrl + Eto go the end of a lineCtrl + Fto go forward one character (right arrow)Ctrl + Bto go backward one character (left arrow)Alt + Fto go forward one word (vimwmotion)Alt + Bto go backward one word (vimbmotion)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "background": "#181818", | |
| "foreground": "p:white", | |
| "style": "powerline", | |
| "properties": { | |
| "display_mode": "environment", | |
| "fetch_virtual_env": true, | |
| "home_enabled": true | |
| }, | |
| "type": "python", |
NewerOlder