This file contains hidden or 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 timeit | |
import numpy as np | |
from collections import Counter | |
from tqdm import tqdm | |
def get_sample(arr, n_iter=None, sample_size=10, | |
fast=True): | |
"""Get random sample from arr. | |
Parameters |
This file contains hidden or 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 timeit | |
import numpy as np | |
from collections import Counter | |
def get_sample(arr, n_iter=None, sample_size=10, | |
fast=True): | |
"""Get random sample from arr. | |
Parameters | |
---------- |
This file contains hidden or 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 | |
import tensorflow as tf | |
from tensorflow.contrib import learn | |
from tensorflow.contrib.learn.python.learn.estimators import model_fn as model_fn_lib | |
tf.logging.set_verbosity(tf.logging.INFO) | |
def cnn_model_fn(features, labels, mode): |
This file contains hidden or 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 torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
import torch.optim as optim | |
from torchvision import datasets, transforms | |
from torch.autograd import Variable | |
# download and transform train dataset | |
train_loader = torch.utils.data.DataLoader(datasets.MNIST('../mnist_data', | |
download=True, |
This file contains hidden or 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 tensorflow as tf | |
import numpy as np | |
def rmse(y, y_hat): | |
"""Compute root mean squared error""" | |
return tf.sqrt(tf.reduce_mean(tf.square((y - y_hat)))) | |
def forward(x, e): | |
"""Forward pass for our fuction""" | |
# tensorflow has automatic broadcasting |
This file contains hidden or 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 tensorflow as tf | |
def rmse(y, y_hat): | |
"""Compute root mean squared error""" | |
return tf.sqrt(tf.reduce_mean(tf.square((y - y_hat)))) | |
def forward(x, e): | |
"""Forward pass for our fuction""" | |
# tensorflow has automatic broadcasting | |
# so we do not need to reshape e manually |
This file contains hidden or 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 torch | |
from torch.autograd import Variable | |
import numpy as np | |
def rmse(y, y_hat): | |
"""Compute root mean squared error""" | |
return torch.sqrt(torch.mean((y - y_hat).pow(2))) | |
def forward(x, e): | |
"""Forward pass for our fuction""" |
This file contains hidden or 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 torch | |
from torch.autograd import Variable | |
import numpy as np | |
def rmse(y, y_hat): | |
"""Compute root mean squared error""" | |
return torch.sqrt(torch.mean((y - y_hat).pow(2).sum())) | |
def forward(x, e): | |
"""Forward pass for our fuction""" |
This file contains hidden or 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
JAVA_OPTIONS="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n -Dweblogic.security.SSL.trustedCAKeyStore="/app/Oracle/Middleware/wlserver_10.3/server/lib/cacerts" ${JAVA_OPTIONS}" | |
export JAVA_OPTIONS |
NewerOlder