i) create config file
$ jupyter notebook --generate-config
ii) create password
import matplotlib.pyplot as plt | |
from datetime import date | |
#data | |
logic_tuple = [(1936, 3), (1937, 6), (1938, 3), (1939, 5), | |
(1940, 2), (1941, 2), (1942, 7), (1943, 1), | |
(1944, 2), (1945, 2), (1947, 2), (1948, 4), | |
(1949, 7), (1950, 3), (1951, 2), (1952, 5), |
from sklearn import linear_model | |
import numpy as np | |
import matplotlib.pyplot as plt | |
# generating fake linear data. | |
# Where x = square meter, y = house price | |
cond = False | |
while not cond: |
import numpy as np | |
import seaborn as sns | |
import matplotlib.pyplot as plt | |
from matplotlib import rc | |
sns.set_style("darkgrid") | |
# for using latex in plt it requires one installation: | |
# $ sudo apt install dvipng | |
rc('font', **{'family': 'sans-serif', 'sans-serif': ['Helvetica']}) |
# strided_slice( | |
# input_, | |
# begin, | |
# end, | |
# strides=None, | |
# begin_mask=0, | |
# end_mask=0, | |
# ellipsis_mask=0, | |
# new_axis_mask=0, | |
# shrink_axis_mask=0, |
# range_input_producer( | |
# limit, | |
# num_epochs=None, | |
# shuffle=True, | |
# seed=None, | |
# capacity=32, | |
# shared_name=None, | |
# name=None) | |
# Produces the integers from 0 to limit-1 in a queue. |
import numpy as np | |
import tensorflow as tf | |
NUM_THREADS = 4 | |
data = np.array([[0.2, 0.3], [0.4, 0.9], [0.8, -1.2], [-1.3, -0.2]]) | |
target = np.array([1, 0, 1, 0]) | |
queue = tf.FIFOQueue(capacity=3, | |
dtypes=[tf.float32, tf.int32], |
#code adapted from http://tillbergmann.com/blog/python-gradient-descent.html | |
%matplotlib inline | |
import numpy as np | |
import seaborn as sns | |
import matplotlib.pyplot as plt | |
import matplotlib.animation as animation | |
from scipy import stats | |
from sklearn.datasets.samples_generator import make_regression |
import numpy as np | |
import random | |
import unittest | |
from math import isnan | |
def softmax(x): | |
""" | |
Compute the softmax function for each row of the input x. | |
It is crucial that this function is optimized for speed because |
import tracemalloc | |
tracemalloc.start() | |
# ... run your application ... | |
snapshot = tracemalloc.take_snapshot() | |
top_stats = snapshot.statistics('lineno') | |
print("[ Top 10 ]") |