Skip to content

Instantly share code, notes, and snippets.

View ziyan0302's full-sized avatar
🎯
Focusing

ziyan0302

🎯
Focusing
View GitHub Profile
@ziyan0302
ziyan0302 / GetFolderSizes.ps1
Last active July 11, 2024 08:51
show the size of the folders in current location
# Get all directories in the current location
$folders = Get-ChildItem -Directory
# Iterate over each directory and calculate its size
foreach ($folder in $folders) {
$folderPath = $folder.FullName
$size = (Get-ChildItem -Recurse -Force $folderPath | Measure-Object -Property Length -Sum).Sum
$sizeMB = [math]::round($size / 1MB, 2)
Write-Output "Folder: $folderPath, Size: $sizeMB MB"
}
import numpy as np
import scipy.signal
from gym.spaces import Box, Discrete
import torch
import torch.nn as nn
from torch.distributions.normal import Normal
from torch.distributions.categorical import Categorical
import torch.nn.functional as F
import pdb
import numpy as np
import torch
from torch.optim import Adam
import gym
import time
import core as core
# from logx import EpochLogger
# from spinup.utils.mpi_pytorch import setup_pytorch_for_mpi, sync_params, mpi_avg_grads
# from spinup.utils.mpi_tools import mpi_fork, mpi_avg, proc_id, mpi_statistics_scalar, num_procs
@ziyan0302
ziyan0302 / cuda11.7_on_Ubuntu20.04
Last active December 30, 2022 10:12
cuda11.7, nvidia510, tf2.11, pytorch1.13
#!/bin/bash
## check nvidia driver version
nvidia-smi
# 510
## to uninstall cuda
# sudo apt-get --purge remove "*cublas*" "cuda*" "nsight*"
# sudo apt-get --purge remove "*nvidia*"
# or
@ziyan0302
ziyan0302 / cuda11.3_installation_on_Ubuntu_20.04
Last active May 8, 2024 16:06
cuda11.3, cudnn11.3, Tensorflow2.8.0, Pytorch1.10.2, ubuntu20.04.txt
#!/bin/bash
## check nvidia driver version
nvidia-smi
# 510
## to uninstall cuda
# sudo apt-get --purge remove "*cublas*" "cuda*" "nsight*"
# sudo apt-get --purge remove "*nvidia*"
# or
@ziyan0302
ziyan0302 / vtt2txt.py
Last active September 28, 2022 19:19
"""
Convert YouTube subtitles(vtt) to human readable text.
Download only subtitles from YouTube with youtube-dl:
youtube-dl -o ytdl-subs --skip-download --write-sub --sub-format vtt <video_url>
Note that default subtitle format provided by YouTube is ass, which is hard
to process with simple regex. Luckily youtube-dl can convert ass to vtt, which
is easier to process.
@ziyan0302
ziyan0302 / cuda_11.2_installation_on_Ubuntu_20.04
Last active November 21, 2021 04:11 — forked from Mahedi-61/cuda_11.8_installation_on_Ubuntu_22.04
CUDA 11.2 Installation on Ubuntu 20.04
#!/bin/bash
## This gist contains instructions about cuda v11.2 and cudnn8.1 installation in Ubuntu 20.04 for Pytorch 1.8
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###