This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
import sys | |
class SubLogger(object): | |
def __init__(self, name, source, logger): | |
self.name = name | |
self.source = source | |
self.logger = logger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
# Creating some random data with 4 columns centered around 10 | |
data = np.random.randn(4, 512) + 10 | |
data = data.astype(np.float32) #np.float64 | |
column_means = np.mean(data, axis=1, keepdims=True) | |
print(column_means.reshape(-1)) | |
# [ 9.975992 9.9283495 10.003674 10.012635 ] | |
# Subtracting the column mean should yield zero-centered columns |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
import matplotlib.pyplot as plt | |
import tensorflow as tf | |
import numpy as np | |
import os | |
from object_detection.utils import label_map_util | |
from object_detection.utils import config_util |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: Ygor Rebouças | |
# | |
### The Training Loop | |
# | |
# 0) Imports | |
import tensorflow as tf | |
import numpy as np |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Reproducing the main findings of the paper "Training BatchNorm and Only BatchNorm: On the Expressive Power of Random Features in CNNs" | |
# Goal: Train a ResNet model to solve the CIFAR-10 dataset using only batchnorm layers, all else is frozen at their random initial state. | |
# https://medium.com/@ygorrebouasserpa | |
# https://www.linkedin.com/in/ygor-rebouças-serpa-11606093/ | |
import tensorflow as tf | |
import numpy as np | |
import pandas as pd |