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
# Exact String Matching | |
def exact_match_deduplication(texts): | |
return list(set(texts)) |
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
def adam(cost_func, X, y, lr=0.01, beta1 = 0.9, beta2 = 0.999, plot=True): | |
""" | |
Adam | |
""" | |
e = 1e-7 | |
params ={'w':np.zeros(X.shape[1]), 'b':0.} | |
params_m = {'w_m': np.zeros(X.shape[1]), 'b_m':0.} | |
params_v = {'w_v': np.zeros(X.shape[1]), 'b_v':0.} |
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
def rmsprop(J, X, y, gamma=0.9, plot=False): | |
"""P | |
RMS prop | |
""" | |
lr = 0.1 # Learning rate | |
e = 1e-7 # Epsilon value to | |
params = { | |
'w': np.zeros(X.shape[1:]), | |
'b': 0. |
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
# Adagrad | |
def adgrad(cost_func, X, y, gamma = 0.9, lr = 0.01, plot= False): | |
""" | |
Adagrad | |
""" | |
e = 1e-7 | |
params = {'w': np.zeros(X.shape[1]), 'b': 0.} | |
# Velocity parameters |