Skip to content

Instantly share code, notes, and snippets.

View fzliu's full-sized avatar

Frank Liu fzliu

View GitHub Profile
@fzliu
fzliu / gresnet.py
Created March 25, 2024 12:42
GResNet model definition.
"""
gresnet.py: (Good/Great/Godlike/Gangster ResNet)
Implementation adapted from torchvision ResNet50 v1.4.
"""
import math
from typing import Any, Callable, Optional, Type, Tuple, Union
from torch import Tensor
import torch
@fzliu
fzliu / state_of_the_union.txt
Created November 5, 2023 22:15
President Biden's address to the country on March 1, 2022
Madam Speaker, Madam Vice President, our First Lady and Second Gentleman. Members of Congress and the Cabinet. Justices of the Supreme Court. My fellow Americans.
Last year COVID-19 kept us apart. This year we are finally together again.
Tonight, we meet as Democrats Republicans and Independents. But most importantly as Americans.
With a duty to one another to the American people to the Constitution.
And with an unwavering resolve that freedom will always triumph over tyranny.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fzliu
fzliu / docker-compose.yml
Created June 23, 2021 04:12
Gitlab minimal memory installation via docker.
web:
image: 'gitlab/gitlab-ee:latest'
restart: always
hostname: 'gitlab.example.com'
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'https://gitlab.example.com'
# Add any other gitlab.rb configuration here, each on its own line
puma['worker_processes'] = 0
sidekiq['max_concurrency'] = 10
from __future__ import print_function
import math
from multiprocessing import Pool
import sys
def divs_and_mults(num, maxval):
@fzliu
fzliu / gen_kasami_seqs.m
Created June 10, 2017 07:33
Uses MATLAB to generate Kasami sequences.
seqs = [];
for n = 0:62
ks = comm.KasamiSequence('Index', n, ...
'Polynomial', [12 6 4 1 0], ...
'InitialConditions', [zeros(1, 11) 1], ...
'SamplesPerFrame',4095);
seq = step(ks);
seq = 2 * (seq - 0.5);
seqs = [seqs seq];
@fzliu
fzliu / download_pixels.py
Created June 9, 2016 04:49
A helper script for downloading images from URLs.
"""
download_pixels.py: A handy utility function for downloading images from URLs.
"""
import os
import shutil
import requests
@fzliu
fzliu / make_cifar10.py
Last active April 28, 2021 08:31
Create image data from raw CIFAR-10 files.
"""
make_cifar10.py: Create training data from raw CIFAR-10 batches.
"""
import pickle
import glob
import os
import numpy as np
from skimage.io import imsave
@fzliu
fzliu / .profile
Last active February 1, 2016 19:40
OS X terminal configuration.
# Display full path in terminal
export PS1="\u@\H:\w$ "
# Set architecture flags
export ARCHFLAGS="-arch x86_64"
# Ensure user-installed binaries take precedence
export PATH=/usr/local/bin:$PATH
# Load .bashrc if it exists