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
data Tree a = Nil Int | Leaf Int [a] | Node Int [a] [Tree a] deriving Show | |
find :: (Ord a, Eq a) => Tree a -> a -> Bool | |
find (Nil _) _ = False | |
find (Leaf _ []) _ = False | |
find (Leaf m (k:ks)) x | |
| x == k = True | |
| x < k = False | |
| x > k = find (Leaf m ks) x | |
find (Node _ [] (t:ts)) x = find t x |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 random | |
import copy | |
import numpy as np | |
from scipy.sparse import lil_matrix | |
class ATM: | |
def __init__(self, K, alpha, beta, max_iter, verbose=0): | |
self.K=K | |
self.alpha = alpha | |
self.beta = beta |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 random | |
import numpy as np | |
from scipy.sparse import lil_matrix | |
class NCTM: | |
def __init__(self, K, alpha, beta, gamma, eta, max_iter, verbose=0): | |
self.K=K | |
self.alpha = alpha | |
self.beta = beta | |
self.gamma = gamma |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 random | |
import numpy as np | |
from scipy.sparse import lil_matrix | |
class CTM: | |
def __init__(self, K, alpha, beta, gamma, max_iter, verbose=0): | |
self.K=K | |
self.alpha = alpha | |
self.beta = beta | |
self.gamma = gamma |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 random | |
import numpy as np | |
from scipy.sparse import lil_matrix | |
class JTM: | |
def __init__(self, K, alpha, beta, max_iter, verbose=0): | |
self.K=K | |
self.alpha = alpha | |
self.beta = beta | |
self.max_iter = max_iter |
NewerOlder