uv init dir_name
will create a new python projectuv init .
in an existing project directory
uv run script.py
will runscript.py
. No need to activate venv, uv will take care of ituv add lib_name
will pulllib_name
from pypi and add it to projectuv remove lib_name
will removelib_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
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 np
Measures 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 (vimw
motion)Alt + B
to go backward one word (vimb
motion)
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