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
from scipy.stats import random_correlation | |
from typing import List, Set | |
import seaborn as sb | |
import numpy as np | |
import matplotlib.pyplot as plt | |
plt.rcParams["figure.figsize"] = (10, 10) | |
# --- Specifying correlation matrix distribution and shape --- | |
rng = np.random.default_rng() |
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
# Change BASE_DIR accordingly. | |
BASE_DIR=/Users/ray_zhang/home/tensorflow/bazel-bin | |
INC=-I$(BASE_DIR)/tensorflow/include -I$(BASE_DIR)/tensorflow -I$(BASE_DIR)/tensorflow/include/src/ | |
LIB=-L$(BASE_DIR)/tensorflow -rpath $(BASE_DIR)/tensorflow -ltensorflow_cc -ltensorflow_framework | |
FLAGS=-std=c++14 | |
main: deserialize.cpp | |
g++ $(FLAGS) $(INC) $(LIB) -o deserialize $^ |
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 module | |
SEEDED = False # for .not_seeded. For .seeded, this is True. | |
NUM_TRIALS = 10 | |
if SEEDED: | |
module.init() | |
for i in range(NUM_TRIALS): |
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
"""Softmax.""" | |
scores = [2.0, 1.0, 0.1] | |
import numpy as np | |
def softmax(x): | |
"""Compute softmax values for each sets of scores in x.""" | |
#We want to find the e^y_i/(sum(e^y) | |
''' Long way |
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
graph - have graph of each individual color | |
greedy algorithm | |
Start at the lowest result from # of orbs calculated w/ the distance - hardest combo to make. | |
longest path algorithm - djikstra's backward | |
find localized solutions as the answer goes towards the solution | |
LBHRLB | |
HRRGRR | |
BDHHGR | |
HRHDRG |
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
int[] state = NIL; // <-- enter threshold from constructor | |
int currentState = 0; <-- state[currentState] = current state | |
int color; | |
public Orb(Color c) | |
color = c; | |
int[] state = new int[1]; | |
state[0] = NIL; | |
public Orb(Color c, State s) | |
color = c; |
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
public class FHlazySTNode<E extends Comparable< ? super E > > | |
{ | |
// use public access so the tree or other classes can access members | |
public FHlazySTNode<E> lftChild, rtChild; | |
public E data; | |
public FHlazySTNode<E> myRoot; // needed to test for certain error | |
public boolean deleted; | |
public FHlazySTNode( E d, FHlazySTNode<E> lft, FHlazySTNode<E> rt ) | |
{ |
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
package cs_1c; | |
public class FHs_treeNode<E extends Comparable< ? super E > > | |
{ | |
// use public access so the tree or other classes can access members | |
public FHs_treeNode<E> lftChild, rtChild; | |
public E data; | |
public FHs_treeNode<E> myRoot; // needed to test for certain error | |
public FHs_treeNode( E d, FHs_treeNode<E> lft, FHs_treeNode<E> rt ) |
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
package cs_1c; | |
import java.util.*; | |
public class FHhashSC<E> | |
{ | |
static final int INIT_TABLE_SIZE = 97; | |
static final double INIT_MAX_LAMBDA = 1.5; | |
protected FHlinkedList<E>[] mLists; | |
protected int mSize; |
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
package cs_1c; | |
//class EBookEntry ----------------------------------------------------- | |
public class EBookEntry implements Comparable<EBookEntry> | |
{ | |
private String title, creator, subject; | |
private int eTextNum; | |
public static final int MIN_STRING = 1; | |
public static final int MAX_STRING = 300; |
NewerOlder