Skip to content

Instantly share code, notes, and snippets.

View jimmykimmy68's full-sized avatar
💭
42: Answer to the Ultimate Question of Life, the Universe, and Everything

Gyeongho Kim (Jim Kim) jimmykimmy68

💭
42: Answer to the Ultimate Question of Life, the Universe, and Everything
View GitHub Profile
@jimmykimmy68
jimmykimmy68 / gradient_reversal_tf_keras.py
Created December 30, 2024 05:15 — forked from oO0oO0oO0o0o00/gradient_reversal_tf_keras.py
Gradient Reversal Layer for tf.keras of TensorFlow 2
import tensorflow as tf
from tensorflow import keras
class GradientReversal(keras.layers.Layer):
"""Flip the sign of gradient during training.
based on https://github.com/michetonu/gradient_reversal_keras_tf
ported to tf 2.x
"""
def __init__(self, λ=1, **kwargs):
@jimmykimmy68
jimmykimmy68 / extract_ILSVRC.sh
Created March 30, 2021 13:23 — forked from BIGBALLON/extract_ILSVRC.sh
script for ImageNet data extract.
#!/bin/bash
#
# script to extract ImageNet dataset
# ILSVRC2012_img_train.tar (about 138 GB)
# ILSVRC2012_img_val.tar (about 6.3 GB)
# make sure ILSVRC2012_img_train.tar & ILSVRC2012_img_val.tar in your current directory
#
# https://github.com/facebook/fb.resnet.torch/blob/master/INSTALL.md
#
# train/