Skip to content

Instantly share code, notes, and snippets.

Interactive Machine Learning

Taught by Brad Knox at the MIT Media Lab in 2014. Course website. Lecture and visiting speaker notes.

import pandas as pd
datelist = pd.date_range(pd.datetime.today(), periods =365).date.tolist()
f = open("2018_planner.txt","w")
for date in datelist:
f.write("# " + str(date) + '\n')
f.close()
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 has to be first to make sure that matplotlib runs in headless mode
import matplotlib
matplotlib.use("Agg")
import sys
import numpy as np
import warnings
warnings.filterwarnings('ignore')
from fa2l import force_atlas2_layout
def set_node_color(G,color_by,colormap=None):
"""
Returns a list of colors for each node based on the provided colormap.
Parameters
___________
G : graph.
A networkx graph.
import math
import networkx as nx
from itertools import combinations
from utils import set_node_size
from fa2l import force_atlas2_layout
def get_distance(pos1,pos2):
""" Returns distance between two points

Tahsin Mayeesha is currently working with Berkman Klein Center Of Internet and Society on interactive network visualization project as a participant of Google Summer Of Code 2018. Previously, she worked in Cramstack on electricity data, a data science startup in Bangladesh focusing on consulting and government project. Currently she's an undergraduate student in North South University, Bangladesh majoring in computer science. She runs "Learning Machine Learning" publication in Medium featuring tutorials and projects. Mayeesha graduated from Udacity's Machine Learning Nanodegree in 2017 and also participated in Fast.ai as an international fellow.

---------------------------------------------------------------------------
InvalidArgumentError Traceback (most recent call last)
~\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py in get_attr(self, name)
2325 with c_api_util.tf_buffer() as buf:
-> 2326 c_api.TF_OperationGetAttrValueProto(self._c_op, name, buf)
2327 data = c_api.TF_GetBuffer(buf)
InvalidArgumentError: Operation 'StatefulPartitionedCall' has no attr named '_XlaCompile'.
During handling of the above exception, another exception occurred:
class LanguageClassifier(tf.train.Checkpoint):
def __init__(self,language_module,num_labels,dense_units=(128,128),dropouts=(0.1,0.1)):
# initialization stuff
super(LanguageClassifier,self).__init__()
self.language_module = language_module
self.model_encoder = language_module.model
# classifier head layers