git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
Generating image embeddings for Hub |
# we know the following graph is nilpontent | |
m = np.array([[0, 1, 0, 0, 0, 0], | |
[0, 0, 1, 1, 0, 0], | |
[0, 0, 0, 0, 0, 0], | |
[0, 0, 0, 0, 1, 1], | |
[0, 0, 0, 0, 0, 1], | |
[0, 0, 1, 0, 0, 0]]) | |
for k in range(len(m)): | |
print(m) |
""" | |
graph examples collected from https://www.cs.hmc.edu/~keller/courses/cs60/s98/examples/acyclic/ | |
in the first example, we have an acylic graph. there exists k such its adjacency | |
matrix m^k == 0. because we cant produce a path of arbitrarily high length (eg | |
greater than k), the graph does not have a cycle. | |
in the second example, we have a cyclic graph. there is no k where its adjacency | |
matrix m^k == 0. |
def create_tokens(source): | |
"""convert source to tokens. | |
convert a string "(first (list 1 (+ 2 3) 9))" into a python list | |
['(', 'first', '(', 'list', '1', '(', '+', '2', '3', ')', '9', ')', ')']. | |
this conversion allows us to recursively inspect each element in the list. | |
""" | |
return source.replace('(',' ( ').replace(')',' ) ').split() |
class Vertex(object): | |
"""represent vertices in a tree/graph.""" | |
def __init__(self, name): | |
self.name = name | |
self.children = {} | |
self.status = None | |
def add_child(self, child): | |
key = child.name | |
self.children[key] = child |
# Image processing function | |
# Usage: In the Terminal, run: bash images.sh | |
# Get user input and resize images | |
function process () { | |
# rename | |
a=1 | |
for i in *.${ext} | |
do |