Skip to content

Instantly share code, notes, and snippets.

View flrngel's full-sized avatar
πŸ₯ƒ

Derrick flrngel

πŸ₯ƒ
View GitHub Profile
@brannondorsey
brannondorsey / pix2pix_paper_notes.md
Last active January 3, 2022 09:57
Notes on the Pix2Pix (pixel-level image-to-image translation) Arxiv paper

Image-to-Image Translation with Conditional Adversarial Networks

Notes from arXiv:1611.07004v1 [cs.CV] 21 Nov 2016

  • Euclidean distance between predicted and ground truth pixels is not a good method of judging similarity because it yields blurry images.
  • GANs learn a loss function rather than using an existing one.
  • GANs learn a loss that tries to classify if the output image is real or fake, while simultaneously training a generative model to minimize this loss.
  • Conditional GANs (cGANs) learn a mapping from observed image x and random noise vector z to y: y = f(x, z)
  • The generator G is trained to produce outputs that cannot be distinguished from "real" images by an adversarially trained discrimintor, D which is trained to do as well as possible at detecting the generator's "fakes".
  • The discriminator D, learns to classify between real and synthesized pairs. The generator learns to fool the discriminator.
  • Unlike an unconditional GAN, both th
@durden
durden / getsizeof_recursive.py
Last active April 23, 2025 18:44
Get size of Python object recursively to handle size of containers within containers
##### Taken from https://github.com/bosswissam/pysize
import sys
def get_size(obj, seen=None):
"""Recursively finds size of objects"""
size = sys.getsizeof(obj)
if seen is None:
seen = set()
@itod
itod / split_keyboards.md
Last active June 18, 2025 03:13
Every "split" mechanical keyboard currently being sold that I know of
@haje01
haje01 / README.md
Last active June 16, 2017 01:46
Distributed TensorFlow

λΆ„μ‚° ν…μ„œν”Œλ‘œμš°

이 글을 μž‘μ„±ν•˜λŠ” μ‹œμ (2017-01-11)μ—μ„œ λΆ„μ‚° ν…μ„œν”Œλ‘œμš°μ˜ κ΄€λ ¨ 자료 λΆ€μ‘±μœΌλ‘œ ν™•μ‹€νžˆ λΆ„μ‚° ν•™μŠ΅μ΄ λ˜λŠ”μ§€ 확인이 λ˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€. μ•ˆνƒ€κΉμ§€λ§Œ λ³Έ λ‚΄μš©μ€ 참고만 ν•˜μ‹œκΈ° λ°”λžλ‹ˆλ‹€.

원문 [https://www.tensorflow.org/how_tos/distributed/] (https://www.tensorflow.org/how_tos/distributed/)

κ°œλ… μ„€λͺ…

  • ν΄λŸ¬μŠ€ν„°λŠ” ν…μ„œν”Œλ‘œμš° κ·Έλž˜ν”„μ˜ λΆ„μ‚° μˆ˜ν–‰μ— μ°Έμ—¬ν•˜λŠ” ν…ŒμŠ€ν¬λ“€μ˜ μ§‘ν•©
@sebble
sebble / stars.sh
Last active July 14, 2025 18:55
List all starred repositories of a GitHub user.
#!/bin/bash
USER=${1:-sebble}
STARS=$(curl -sI https://api.github.com/users/$USER/starred?per_page=1|egrep '^Link'|egrep -o 'page=[0-9]+'|tail -1|cut -c6-)
PAGES=$((658/100+1))
echo You have $STARS starred repositories.
echo

Note

Apple will reject apps that are using private url schemes (Ugh, Apple....) if they are pretty much obvius. Some apps are rejected and others are not, so, be aware of this issue before implementing any of those URL's in your app as a feature.

Updates

  • [UPDATE 4] iOS 10 update: apparently settings now can be reached using App-Pref instead of prefs
  • [UPDATE 3] For now you just can use url schemes to open your apps's settings with Swift 3.0 (Xcode 8). I'll keep you informed when OS preferences can be reached
  • [UPDATE 2] The openURL() method of UIApplication is now deprecated. You should use application(_:open:options:) instead
  • [UPDATE 1] Not yet tested in iOS 10. It will fail because of policies changes in URL scheme handling.
@j-min
j-min / exp_lr_scheduler.py
Created June 25, 2017 14:07
learning rate decay in pytorch
# http://pytorch.org/tutorials/beginner/transfer_learning_tutorial.html
def exp_lr_scheduler(optimizer, epoch, init_lr=0.001, lr_decay_epoch=7):
"""Decay learning rate by a factor of 0.1 every lr_decay_epoch epochs."""
lr = init_lr * (0.1**(epoch // lr_decay_epoch))
if epoch % lr_decay_epoch == 0:
print('LR is set to {}'.format(lr))
for param_group in optimizer.param_groups:
@siwalikm
siwalikm / aes-256-cbc.js
Last active July 17, 2025 12:11
AES-256-CBC implementation in nodeJS with built-in Crypto library
'use strict';
const crypto = require('crypto');
const ENC_KEY = "bf3c199c2470cb477d907b1e0917c17b"; // set random encryption key
const IV = "5183666c72eec9e4"; // set random initialisation vector
// ENC_KEY and IV can be generated as crypto.randomBytes(32).toString('hex');
const phrase = "who let the dogs out";
var encrypt = ((val) => {