repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
infilect/ml-course1
keras-notebooks/Transfer-Learning/5.3.1 Keras and TF Integration.ipynb
mit
import tensorflow as tf tf.__version__ from tensorflow.contrib import keras """ Explanation: Tight Integration End of explanation """ from keras.datasets import cifar100 (X_train, Y_train), (X_test, Y_test) = cifar100.load_data(label_mode='fine') from keras import backend as K img_rows, img_cols = 32, 32 if K....
azhurb/deep-learning
tensorboard/Anna_KaRNNa_Hyperparameters.ipynb
mit
import time from collections import namedtuple import numpy as np import tensorflow as tf """ Explanation: Anna KaRNNa In this notebook, I'll build a character-wise RNN trained on Anna Karenina, one of my all-time favorite books. It'll be able to generate new text based on the text from the book. This network is base...
mtasende/Machine-Learning-Nanodegree-Capstone
notebooks/prod/.ipynb_checkpoints/n08_simple_q_learner_1000_states-checkpoint.ipynb
mit
# Basic imports import os import pandas as pd import matplotlib.pyplot as plt import numpy as np import datetime as dt import scipy.optimize as spo import sys from time import time from sklearn.metrics import r2_score, median_absolute_error from multiprocessing import Pool %matplotlib inline %pylab inline pylab.rcPar...
rueedlinger/machine-learning-snippets
notebooks/automl/classification_with_automl.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import seaborn as sns import pandas as pd import numpy as np from sklearn import datasets, metrics, model_selection, preprocessing, pipeline import warnings warnings.simplefilter(action='ignore', category=FutureWarning) import autosklearn.classification wine = data...
ES-DOC/esdoc-jupyterhub
notebooks/ncc/cmip6/models/sandbox-3/toplevel.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'ncc', 'sandbox-3', 'toplevel') """ Explanation: ES-DOC CMIP6 Model Properties - Toplevel MIP Era: CMIP6 Institute: NCC Source ID: SANDBOX-3 Sub-Topics: Radiative Forcings. Properties: 85 (42 re...
tensorflow/docs-l10n
site/ja/lite/performance/post_training_quant.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
basp/notes
squares_and_roots.ipynb
mit
def plot_rect(ax, p, fmt='b'): x, y = p ax.plot([0, x], [y, y], fmt) # horizontal line ax.plot([x, x], [0, y], fmt) # vertical line with plt.xkcd(): fig, axes = plt.subplots(1, figsize=(4, 4)) pu.setup_axes(axes, xlim=(-1, 4), ylim=(-1, 4)) for x in [1,2,3]: plot_rect(axes, (x, x)) """ Exp...
fantasycheng/udacity-deep-learning-project
tutorials/intro-to-rnns/Anna_KaRNNa_Exercises.ipynb
mit
import time from collections import namedtuple import numpy as np import tensorflow as tf """ Explanation: Anna KaRNNa In this notebook, we'll build a character-wise RNN trained on Anna Karenina, one of my all-time favorite books. It'll be able to generate new text based on the text from the book. This network is bas...
aylward/ITKTubeTK
examples/Demo-ConvertTubesToImage.ipynb
apache-2.0
import os import sys import numpy import itk from itk import TubeTK as ttk from itkwidgets import view """ Explanation: Convert Tubes To Images This notebook contains a few examples of how to call wrapped methods in itk and ITKTubeTK. ITK, ITKTubeTK, and ITKWidgets must be installed on your system for this notebook t...
bzamecnik/ml
instrument-classification/analyze_instrument_ranges.ipynb
mit
plt.hist(x_rms_instruments_notes[x_rms_instruments_notes <= 1].flatten(), 200); plt.hist(x_rms_instruments_notes[x_rms_instruments_notes > 1].flatten(), 200); """ Explanation: There's a peak at value around 1.0 which represents quiet. End of explanation """ plt.imshow(x_rms_instruments_notes > 1, interpolation='non...
gouthambs/karuth-source
content/extra/notebooks/numba_example.ipynb
artistic-2.0
import numpy as np import numba import cython %load_ext cython import pandas as pd numba.__version__, cython.__version__, np.__version__ """ Explanation: Optimizing Python Code: Numba vs Cython Goutham Balaraman I came across an old post by jakevdp on Numba vs Cython. I thought I will revisit this topic because both...
CalPolyPat/phys202-project
.ipynb_checkpoints/NeuralNetworks-checkpoint.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt from IPython.html.widgets import interact from sklearn.datasets import load_digits digits = load_digits() print(digits.data.shape) def show_digit(i): plt.matshow(digits.images[i]); interact(show_digit, i=(0,100)); """ Explanation: Neural Networks This project w...
maxis42/ML-DA-Coursera-Yandex-MIPT
1 Mathematics and Python/Lectures notebooks/10 numpy arrays and operations with them/matrix_operations-.ipynb
mit
import numpy as np """ Explanation: NumPy: матрицы и операции над ними В этом ноутбуке из сторонних библиотек нам понадобится только NumPy. Для удобства импортируем ее под более коротким именем: End of explanation """ a = np.array([[1, 2, 3], [2, 5, 6], [6, 7, 4]]) print "Матрица:\n", a """ Explanation: 1. Создани...
sadahanu/Capstone
SCRAPE/review_gather.ipynb
mit
# create the category data frame cat_id = [1,2,3,4,5] category = ['Balls and Fetch Toys','Chew Toys','Plush Toys','Interactive Toys','Rope and Tug'] link = ['https://www.chewy.com/s?rh=c%3A288%2Cc%3A315%2Cc%3A317','https://www.chewy.com/s?rh=c%3A288%2Cc%3A315%2Cc%3A316', 'https://www.chewy.com/s?rh=c%3A288%2Cc%3...
RJTK/dwglasso_cweeds
notebooks/clean_data.ipynb
mit
print('Original bounds: ', t[0], t[-1]) t_obs = t[D['T_flag'] != -1] D = D[t_obs[0]:t_obs[-1]] # Truncate dataframe so it is sandwiched between observed values t = D.index T = D['T'] print('New bounds: ', t[0], t[-1]) t_obs = D.index[D['T_flag'] != -1] t_interp = D.index[D['T_flag'] == -1] T_obs = D.loc[t_obs, 'T'] ...
kit-cel/wt
sigNT/systems/frequency_response.ipynb
gpl-2.0
# importing import numpy as np import matplotlib.pyplot as plt import matplotlib # showing figures inline %matplotlib inline # plotting options font = {'size' : 20} plt.rc('font', **font) plt.rc('text', usetex=True) matplotlib.rc('figure', figsize=(18, 10) ) """ Explanation: Content and Objective Show that fre...
navaro1/deep-learning
intro-to-tflearn/TFLearn_Sentiment_Analysis.ipynb
mit
import pandas as pd import numpy as np import tensorflow as tf import tflearn from tflearn.data_utils import to_categorical """ Explanation: Sentiment analysis with TFLearn In this notebook, we'll continue Andrew Trask's work by building a network for sentiment analysis on the movie review data. Instead of a network w...
dlsun/symbulate
docs/conditioning.ipynb
mit
from symbulate import * %matplotlib inline """ Explanation: Symbulate Documentation Conditioning <a id='contents'></a> Conditional distributions Conditioning with | Conditioning events Conditioning on multiple events Conditioning on events in a probability space Conditioning on the value of a continuous RV Specifying...
zlxs23/Python-Cookbook
data_structure_and_algorithm_py3_5.ipynb
apache-2.0
rows = [ {'fname': 'Brian', 'lname': 'Jones', 'uid': 1003}, {'fname': 'David', 'lname': 'Beazley', 'uid': 1002}, {'fname': 'John', 'lname': 'Cleese', 'uid': 1001}, {'fname': 'Big', 'lname': 'Jones', 'uid': 1004} ] # 根据任意dict field 来排序输入结果行 from operator import itemgetter rows_by_fname = sorted(rows,key=...
ES-DOC/esdoc-jupyterhub
notebooks/noaa-gfdl/cmip6/models/sandbox-2/atmoschem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'noaa-gfdl', 'sandbox-2', 'atmoschem') """ Explanation: ES-DOC CMIP6 Model Properties - Atmoschem MIP Era: CMIP6 Institute: NOAA-GFDL Source ID: SANDBOX-2 Topic: Atmoschem Sub-Topics: Transport, ...
ud3sh/coursework
deeplearning.ai/coursera-improving-neural-networks/week1/assignment1/Initialization.ipynb
unlicense
import numpy as np import matplotlib.pyplot as plt import sklearn import sklearn.datasets from init_utils import sigmoid, relu, compute_loss, forward_propagation, backward_propagation from init_utils import update_parameters, predict, load_dataset, plot_decision_boundary, predict_dec %matplotlib inline plt.rcParams['f...
sarahmid/programming-bootcamp-v2
lab6_exercises_ANSWERS.ipynb
mit
def fancy_calc(a, b, c): x1 = basic_calc(a,b) x2 = basic_calc(b,c) x3 = basic_calc(c,a) z = x1 * x2 * x3 return z def basic_calc(x, y): result = x + y return result x = 1 y = 2 z = 3 result = fancy_calc(x, y, z) """ Explanation: Programming Bootcamp 2016 Lesson 6 Exercises -- ANSWERS Ea...
p-chambers/occ_airconics
examples/notebooks/notebook_examples.ipynb
bsd-3-clause
from airconics import LiftingSurface, Engine, Fuselage import airconics.AirCONICStools as act from airconics.Addons.WebServer.TornadoWeb import TornadoWebRenderer from IPython.display import display """ Explanation: Notebook for Airconics examples This IPython notebook contains examples for generating and rendering th...
Pybonacci/notebooks
Explorando el Planeta Nueve con Python usando poliastro.ipynb
bsd-2-clause
!conda install -qy poliastro --channel poliastro # Instala las dependencias con conda !pip uninstall poliastro -y #!pip install -e /home/juanlu/Development/Python/poliastro.org/poliastro !pip install https://github.com/poliastro/poliastro/archive/planet9-fixes.zip # Instala la versión de desarrollo %load_ext versi...
davofis/computational_seismology
05_pseudospectral/ps_derivative_solution.ipynb
gpl-3.0
# Import all necessary libraries, this is a configuration step for the exercise. # Please run it before the simulation code! import numpy as np import matplotlib.pyplot as plt # Show the plots in the Notebook. plt.switch_backend("nbagg") """ Explanation: <div style='background-image: url("../../share/images/header.sv...
dfm/emcee
docs/tutorials/parallel.ipynb
mit
%config InlineBackend.figure_format = "retina" from matplotlib import rcParams rcParams["savefig.dpi"] = 100 rcParams["figure.dpi"] = 100 rcParams["font.size"] = 20 import multiprocessing multiprocessing.set_start_method("fork") """ Explanation: (parallel)= Parallelization End of explanation """ import os os.en...
mne-tools/mne-tools.github.io
stable/_downloads/548b4fc45f1ed79527138879cd79d3c8/muscle_detection.ipynb
bsd-3-clause
# Authors: Adonay Nunes <adonay.s.nunes@gmail.com> # Luke Bloy <luke.bloy@gmail.com> # License: BSD-3-Clause import os.path as op import matplotlib.pyplot as plt import numpy as np from mne.datasets.brainstorm import bst_auditory from mne.io import read_raw_ctf from mne.preprocessing import annotate_muscle_zs...
jgarciab/wwd2017
class4/class4b_inclass.ipynb
gpl-3.0
##Some code to run at the beginning of the file, to be able to show images in the notebook ##Don't worry about this cell #Print the plots in this screen %matplotlib inline #Be able to plot images saved in the hard drive from IPython.display import Image #Make the notebook wider from IPython.core.display import dis...
GoogleCloudPlatform/training-data-analyst
quests/tpu/flowers_resnet.ipynb
apache-2.0
import os PROJECT = 'cloud-training-demos' # REPLACE WITH YOUR PROJECT ID BUCKET = 'cloud-training-demos-ml' # REPLACE WITH YOUR BUCKET NAME REGION = 'us-central1' # REPLACE WITH YOUR BUCKET REGION e.g. us-central1 # do not change these os.environ['PROJECT'] = PROJECT os.environ['BUCKET'] = BUCKET os.environ['REGION']...
Danghor/Algorithms
Python/Chapter-04/Digit-Recognition.ipynb
gpl-2.0
import gzip import pickle import numpy as np """ Explanation: Handwritten Digit Recognition using $k$-Nearest Neighbours This notebook uses the <em style="color:blue;">$k$-nearest neighbours algorithm</em> to recognize handwritten digits. The digits we want to recognize are stored as images of size $28 \times 28$ pix...
tpin3694/tpin3694.github.io
python/pandas_list_comprehension.ipynb
mit
# Import modules import pandas as pd # Set ipython's max row display pd.set_option('display.max_row', 1000) # Set iPython's max column width to 50 pd.set_option('display.max_columns', 50) """ Explanation: Title: Using List Comprehensions With Pandas Slug: pandas_list_comprehension Summary: Using List Comprehensions ...
John-Keating/ThinkStats2
code/chap04ex.ipynb
gpl-3.0
%matplotlib inline import nsfg preg = nsfg.ReadFemPreg() """ Explanation: Exercise from Think Stats, 2nd Edition (thinkstats2.com)<br> Allen Downey Read the pregnancy file. End of explanation """ import thinkstats2 as ts live = preg[preg.outcome == 1] wgt_cdf = ts.Cdf(live.totalwgt_lb, label = 'weight') """ Expl...
bosscha/alma-calibrator
notebooks/2mass/10_PCA_combine_test_matchagain.ipynb
gpl-2.0
obj = ["PKS J0006-0623", 1.55789, -6.39315, 1] # name, ra, dec, radius of cone obj_name = obj[0] obj_ra = obj[1] obj_dec = obj[2] cone_radius = obj[3] obj_coord = coordinates.SkyCoord(ra=obj_ra, dec=obj_dec, unit=(u.deg, u.deg), frame="icrs") data_2mass = Irsa.query_region(obj_coord, catalog="fp_psc", radius=cone...
mila-udem/summerschool2015
fuel_tutorial/fuel_logreg.ipynb
bsd-3-clause
import numpy import theano from theano import tensor # Size of the data n_in = 28 * 28 # Number of classes n_out = 10 x = tensor.matrix('x') W = theano.shared(value=numpy.zeros((n_in, n_out), dtype=theano.config.floatX), name='W', borrow=True) b = theano.shared(value=numpy.zeros((n...
as595/AllOfYourBases
CDT-KickOff/LECTURE/GPMIntro.ipynb
gpl-3.0
%matplotlib inline """ Explanation: ============================================================================================== &lsaquo; GPMIntro.ipynb &rsaquo; Copyright (C) &lsaquo; 2017 &rsaquo; &lsaquo; Anna Scaife - anna.scaife@manchester.ac.uk &rsaquo; This program is free software: you can redistribute it ...
csiu/100daysofcode
datamining/2017-03-04-day08.ipynb
mit
d = cmudict.dict() def readability_ease(num_sentences, num_words, num_syllables): asl = num_words / num_sentences asw = num_syllables / num_words return(206.835 - (1.015 * asl) - (84.6 * asw)) def readability_ease_interpretation(x): if 90 <= x: res = "5th grade] " res += "Very eas...
mne-tools/mne-tools.github.io
0.15/_downloads/plot_point_spread.ipynb
bsd-3-clause
import os.path as op import numpy as np from mayavi import mlab import mne from mne.datasets import sample from mne.minimum_norm import read_inverse_operator, apply_inverse from mne.simulation import simulate_stc, simulate_evoked """ Explanation: Corrupt known signal with point spread The aim of this tutorial is to...
indiependente/Social-Networks-Structure
results/Watts-Strogatz Results Analysis.ipynb
mit
#!/usr/bin/python %matplotlib inline import numpy as np import matplotlib.pyplot as plt from stats import parse_results, get_percentage, get_avg_per_seed, draw_pie, draw_bars, draw_bars_comparison, draw_avgs """ Explanation: Watts-Strogatz Graph Experiments Output Visualization End of explanation """ pr, eigen, bet ...
ngcm/training-public
FEEG6016 Simulation and Modelling/08-Finite-Elements-Lab-2.ipynb
mit
from IPython.core.display import HTML css_file = 'https://raw.githubusercontent.com/ngcm/training-public/master/ipython_notebook_styles/ngcmstyle.css' HTML(url=css_file) """ Explanation: Finite Elements Lab 2 Worksheet End of explanation """ %matplotlib inline import numpy from matplotlib import pyplot from matplotl...
jhillairet/scikit-rf
doc/source/examples/metrology/Measuring a Mutiport Device with a 2-Port Network Analyzer.ipynb
bsd-3-clause
import skrf as rf from itertools import combinations %matplotlib inline from pylab import * rf.stylely() """ Explanation: Measuring a Multiport Device with a 2-Port Network Analyzer Introduction In microwave measurements, one commonly needs to measure a n-port device with a m-port network analyzer ($m<n$ of course). ...
metpy/MetPy
v0.9/_downloads/ef4bfbf049be071a6c648d7918a50105/Simple_Sounding.ipynb
bsd-3-clause
import matplotlib.pyplot as plt import numpy as np import pandas as pd import metpy.calc as mpcalc from metpy.cbook import get_test_data from metpy.plots import add_metpy_logo, SkewT from metpy.units import units # Change default to be better for skew-T plt.rcParams['figure.figsize'] = (9, 9) # Upper air data can be...
nadvamir/deep-learning
weight-initialization/weight_initialization.ipynb
mit
%matplotlib inline import tensorflow as tf import helper from tensorflow.examples.tutorials.mnist import input_data print('Getting MNIST Dataset...') mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) print('Data Extracted.') """ Explanation: Weight Initialization In this lesson, you'll learn how to fin...
UWSEDS/LectureNotes
PreFall2018/Objects/Building Software With Objects.ipynb
bsd-2-clause
from IPython.display import Image Image(filename='Classes_vs_Objects.png') """ Explanation: Why Objects? Provide modularity and reuse through hierarchical structures Object oriented programming is a different way of thinking. Programming With Objects End of explanation """ # Definiting a Car class class Car(objec...
dnc1994/MachineLearning-UW
ml-clustering-and-retrieval/6_hierarchical_clustering.ipynb
mit
import graphlab import matplotlib.pyplot as plt import numpy as np import sys import os import time from scipy.sparse import csr_matrix from sklearn.cluster import KMeans from sklearn.metrics import pairwise_distances %matplotlib inline """ Explanation: Hierarchical Clustering Hierarchical clustering refers to a class...
5agado/data-science-learning
statistics/Statistics - Basic Theorems.ipynb
apache-2.0
%matplotlib notebook import numpy as np import seaborn as sns sns.set_context("paper") """ Explanation: Table of Contents Law Of Large Numbers Central Limit Theorem Experiment: Sum Of N Dice End of explanation """ # Define info for die population die = np.arange(6)+1 die_dist = np.array([1/len(values)]*len(values...
tensorflow/examples
courses/udacity_intro_to_tensorflow_for_deep_learning/l08c09_forecasting_with_cnn.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
GoogleCloudPlatform/training-data-analyst
CPB100/lab4a/demandforecast.ipynb
apache-2.0
import google.datalab.bigquery as bq import pandas as pd import numpy as np import shutil %bq tables describe --name bigquery-public-data.new_york.tlc_yellow_trips_2015 """ Explanation: Demand forecasting with BigQuery and TensorFlow In this notebook, we will develop a machine learning model to predict the demand for...
mne-tools/mne-tools.github.io
0.24/_downloads/72bb0e260a352fd7c21fee1dd2f83d79/decoding_spoc_CMC.ipynb
bsd-3-clause
# Author: Alexandre Barachant <alexandre.barachant@gmail.com> # Jean-Remi King <jeanremi.king@gmail.com> # # License: BSD-3-Clause import matplotlib.pyplot as plt import mne from mne import Epochs from mne.decoding import SPoC from mne.datasets.fieldtrip_cmc import data_path from sklearn.pipeline import make...
GoogleCloudPlatform/training-data-analyst
learning_rate.ipynb
apache-2.0
!sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst # Install Sklearn !python3 -m pip install --user sklearn # Ensure the right version of Tensorflow is installed. !pip freeze | grep tensorflow==2.1 || pip install tensorflow==2.1 """ Explanation: Observing Learning Curve Changes Learning Objectives Le...
PythonFreeCourse/Notebooks
week01/7_Logic_Operators.ipynb
mit
print("True and True => " + str(True and True)) print("False and True => " + str(False and True)) print("True and False => " + str(True and False)) print("False and False => " + str(False and False)) """ Explanation: <img src="images/logo.jpg" style="display: block; margin-left: auto; margin-right: auto;" alt="לוגו של...
Jackporter415/phys202-2015-work
assignments/assignment08/InterpolationEx01.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import seaborn as sns import numpy as np from scipy.interpolate import interp2d from scipy.interpolate import interp1d """ Explanation: Interpolation Exercise 1 End of explanation """ with np.load('trajectory.npz') as data: t = data['t'] x = data['x'] y...
ethen8181/machine-learning
reinforcement_learning/multi_armed_bandits.ipynb
mit
# code for loading the format for the notebook import os # path : store the current path to convert back to it later path = os.getcwd() os.chdir(os.path.join('..', 'notebook_format')) from formats import load_style load_style(css_style='custom2.css', plot_style=False) os.chdir(path) # 1. magic for inline plot # 2. ...