Skip to content

Instantly share code, notes, and snippets.

View dongzhuoyao's full-sized avatar
💭
I may be slow to respond.

Tao Hu dongzhuoyao

💭
I may be slow to respond.
View GitHub Profile
from abc import abstractmethod
from functools import partial
import math
from typing import Iterable
import numpy as np
import torch
import torch as th
import torch.nn as nn
import torch.nn.functional as F
@dongzhuoyao
dongzhuoyao / README.txt
Created March 23, 2021 16:34
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.1+commit.df193b15.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
import torch
from torch import nn
from torch.nn import functional as F
import math
class LayerNorm(nn.Module):
def __init__(self, eps=1e-6):
super().__init__()
self.eps = eps
@dongzhuoyao
dongzhuoyao / ivi-install-gcc5.4.md
Last active October 26, 2023 07:45
ivi cheatsheet

python main.py data=in32_pickle sg.params.condition_method=cluster dynamic=unet_fast dynamic.params.model_channels=128 data.params.batch_size=128 sg.params.cond_dim=10000 data.h5_file=sg_data/cluster/v3_in32p_cluster10000_iter30minp200_nns-1_dino_vitb16_2022-08-17T21_7b919c8.h5 sg.params.cond_drop_prob=0.1 sg.params.cond_scale=2 data.trainer.max_epochs=800 data.fid_every_n_epoch=10 name=aaaa_ep800_4gpu pl.trainer.strategy=ddp devices=4 debug=0

python main.py data=in32_pickle dynamic=unet_fast sg.params.condition_method=label sg.params.cond_drop_prob=0.1 sg.params.cond_scale=2 dynamic.params.model_channels=128 sg.params.cond_dim=1000 data.trainer.max_epochs=20 data.fid_every_n_epoch=4 data.params.batch_size=128 name=aaaa_v1.6.2_label_in32p_unet_fast_ep8800 debug=0 data.trainer.max_epochs=8800 data.fid_every_n_epoch=10 pl.trainer.strategy=ddp devices=4 debug=0

python main.py data=in32_pickle dynamic=unet_fast sg.params.condition_method=label sg.params.cond_drop_prob=0.1 sg.params.cond_scale=2 dynamic.params.m

srun -u --pty --gres=gpu:1 --mem=60G --cpus-per-task=20 --time=6-23 bash -i
srun -u --pty --gres=gpu:1 --mem=60G --cpus-per-task=20 --time=6-23 python myscript.py
@dongzhuoyao
dongzhuoyao / music_oversea.txt
Created November 17, 2018 12:20 — forked from 0x5e/music_oversea.txt
绕过海外音乐版权限制(网易云音乐、QQ音乐、酷狗音乐、酷我音乐、百度音乐)
Iee9keaYk+mfs+S5kAp8fG11c2ljLjE2My5jb20KQEAqLm11c2ljLjEyNi5uZXQKCiFRUemfs+S5kAp8
fHkucXEuY29tXgp8fGkueS5xcS5jb20vdjgvcGxheXNvbmcuaHRtbAp8fGMueS5xcS5jb20vdjgvZmNn
LWJpbi9mY2dfcGxheV9zaW5nbGVfc29uZy5mY2cKQEBkbC5zdHJlYW0ucXFtdXNpYy5xcS5jb20KCiHp
hbfni5fpn7PkuZAKfHxrdWdvdS5jb21eCnx8aXAua3Vnb3UuY29tL2NoZWNrL2lzY24KQEBmcy5vcGVu
Lmt1Z291LmNvbQoKIemFt+aIkemfs+S5kAp8fGt1d28uY25eCnx8aXBjaGVjay5rdXdvLmNuL2lwX2No
ZWNrLmt1d28KQEBzeWNkbi5rdXdvLmNuXgoKIeeZvuW6pumfs+S5kAp8fG11c2ljLmJhaWR1LmNvbS9k
YXRhL3VzZXIvbG9jYXRpb24KQEB5aW55dWVzaGl0aW5nLmJhaWR1LmNvbQo=
@dongzhuoyao
dongzhuoyao / gist:16a937053bff06e074cf272f2e2e4c91
Last active November 1, 2018 19:12
LISA and DAS instruction
###LIST
###DAS
1. install conda locally(very easy)
2. change .bashrc
@dongzhuoyao
dongzhuoyao / install_opencv3.sh
Last active July 21, 2018 15:00
Install OpenCV 3 with Python 2.7 on Ubuntu
# Configuration
HOME_DIR=/home/[user]/
VERSION=3.1.0
# Installation
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y build-essential cmake pkg-config
sudo apt-get install -y libjpeg8-dev libtiff5-dev libjasper-dev libpng12-dev
sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
@dongzhuoyao
dongzhuoyao / install_opencv2_ubuntu.sh
Last active July 21, 2018 13:40 — forked from arthurbeggs/install_opencv2_ubuntu.sh
Install OpenCV2 in Ubuntu
#!/bin/bash
################################################################################
### OpenCV2 Installation Script ###
################################################################################
# Source code at https://github.com/arthurbeggs/scripts #
################################################################################
# #
# Feel free to copy and modify this file. Giving me credit for it is your #
# choice, but please keep references to other people's work, which I don't #
```
sudo fdisk -l
sudo mount -t ext4 /dev/sda1 /data1 &&
sudo mount -t ext4 /dev/sdb1 /data2 &&
sudo mount -t ext4 /dev/sdc1 /data3 &&
sudo mount -t ext4 /dev/sde1 /data4 &&
sudo mount -t ext4 /dev/sdf1 /data5 &&
sudo mount -t ext4 /dev/sdg1 /data6
```