Skip to content

Instantly share code, notes, and snippets.

@cy-xu
cy-xu / 2D_spiral_array.py
Created February 23, 2022 06:19
facebook/meta 2D spiral array
"""
Find the pattern and complete the function:
int[][] spiral(int n);
where n is the size of the 2D array.
input = 3
123
894
765
@cy-xu
cy-xu / email_clean_up.py
Last active August 27, 2021 00:01
Email addresses clean up - remove nonsense from a long list of emails
""" Remove nonsense from a long list of emails
hello.xu@gmail.com
"""
raw_emails_file = './email_addresses.txt'
clean_email_file = './clean_email_addresses.txt'
raw_emails = open(raw_emails_file, 'r').readlines()
clean_emails = open(clean_email_file, 'w')
import pdb
import glob
import astrodata
# import dragon packages
from recipe_system import cal_service
from recipe_system.reduction.coreReduce import Reduce
from gempy.utils import logutils
from gempy.adlibrary import dataselect
@cy-xu
cy-xu / styleGAN2_paper.md
Last active December 23, 2019 18:13
notes from styleGAN 2 paper

Analyzing and Improving the Image Quality of styleGAN

1. Introduction

  • original StyleGAN was special as it maps input code z to an intermediate latent code w, which applied to AdaIN layers
  • stochastic variation helps the intermediate latent space W to be less entangled
  • this paper investigates and fixes:
    • a. a droplet artifact in original StyleGAN paper via a redesigned norm in generator
    • b. artifacts caused by progressive growing design via a mixture of skip-connection and residual nets
  • FID and P&R are useful but both based on classifier nets that shown to focus on textures rather than shapes
  • PPL metric correlates with consistency and stability of shapes, this is expensive so texecuted less frequently
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.