This file contains 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
# 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" | |
} |
This file contains 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 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 |
This file contains 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 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 |
This file contains 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
#!/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 |
This file contains 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
#!/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 |
This file contains 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
""" | |
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. |
This file contains 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
#!/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 | |
### |