Skip to content

Instantly share code, notes, and snippets.

View justanotherminh's full-sized avatar
🙉

Luong-Minh Nguyen justanotherminh

🙉
  • Microsoft
  • North Carolina
View GitHub Profile
import time
from collections import deque
import sys
sys.setrecursionlimit(10000)
class Node(object):
def __init__(self, name):
self.name = name
self.explored = False
import time
import random
import copy
# j4f
def runtime(func, args):
now = time.time()
func(args)
return time.time() - now
counts = 0
def quicksort(arr):
global counts
if len(arr) >= 1:
counts += len(arr)-1
if len(arr) <= 1:
return arr
else:
import time
inv = 0
def mergesort(arr):
global inv
if len(arr) <= 1:
return arr
else:
import numpy as np
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data', one_hot=True)
def softmax(logits):
e = np.exp(logits)
return e / np.expand_dims(e.sum(axis=1), axis=1)