repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
nerdcommander/scientific_computing_2017
lesson16/Lesson16_team_imp.ipynb
mit
def factorial(n): """calculates n factorial""" print('n is ', n) if n == 0: return 1 else: print('need factorial of', n-1) answer = factorial(n-1) print ('factorial of ', n-1, 'was', answer) return answer * n factorial(3) """ Explanation: Unit 2: Programming Des...
mqvist/CarND-Behavioral-Cloning
Experiment_2.ipynb
mit
import os from PIL import Image def get_record_and_image(index): record = df.iloc[index] path = os.path.join('data', record.center) return record, Image.open(path) def layer_info(model): for n, layer in enumerate(model.layers, 1): print('Layer {:2} {:16} input shape {} output shape {}'.format(...
GoogleCloudPlatform/asl-ml-immersion
notebooks/supplemental/labs/deepconv_gan.ipynb
apache-2.0
try: %tensorflow_version 2.x except Exception: pass import tensorflow as tf tf.__version__ # To generate GIFs !python3 -m pip install -q imageio import glob import os import time import imageio import matplotlib.pyplot as plt import numpy as np import PIL from IPython import display from tensorflow.keras i...
WNoxchi/Kaukasos
FADL1/L3CA2_rossmann_old.ipynb
mit
%matplotlib inline %reload_ext autoreload %autoreload 2 # from fastai.imports import * # from fastai.torch_imports import * from fastai.structured import * # non-PyTorch specfc Machine-Learning tools; indep lib # from fastai.dataset import * # lets us do fastai PyTorch stuff w/ structured columnar data from fastai.col...
m2dsupsdlclass/lectures-labs
labs/06_deep_nlp/Transformers_Joint_Intent_Classification_Slot_Filling.ipynb
mit
import tensorflow as tf tf.__version__ !nvidia-smi # TODO: update this notebook to work with the latest version of transformers %pip install -q transformers==2.11.0 """ Explanation: Joint Intent Classification and Slot Filling with Transformers The goal of this notebook is to fine-tune a pretrained transformer-based...
mne-tools/mne-tools.github.io
0.19/_downloads/85e12f42707b248635bc0c477c2ffc2f/plot_mne_solutions.ipynb
bsd-3-clause
# Author: Eric Larson <larson.eric.d@gmail.com> # # License: BSD (3-clause) import mne from mne.datasets import sample from mne.minimum_norm import make_inverse_operator, apply_inverse print(__doc__) data_path = sample.data_path() subjects_dir = data_path + '/subjects' # Read data fname_evoked = data_path + '/MEG/s...
mne-tools/mne-tools.github.io
0.12/_downloads/plot_dipole_fit.ipynb
bsd-3-clause
from os import path as op import numpy as np import matplotlib.pyplot as plt import mne from mne.forward import make_forward_dipole from mne.evoked import combine_evoked from mne.simulation import simulate_evoked data_path = mne.datasets.sample.data_path() subjects_dir = op.join(data_path, 'subjects') fname_ave = op....
ernestyalumni/servetheloop
CurveFit/CurveFit.ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt import pandas as pd from scipy.optimize import curve_fit from scipy.stats import gamma # for drag vs. v fit SUBDIR = './rawdata/' # subdirectory with all data """ Explanation: CurveFit Various (nonlinear) curve fitting methods needed at various t...
vkpedia/databuff
random-walks/YouTube-Spam/YouTube_Spam_Collection (Part 2).ipynb
mit
# Import modules import numpy as np import pandas as pd """ Explanation: YouTube Spam Collection Data Set (Part 2) Source: UCI Machine Learning Repository Original Source: YouTube Spam Collection v. 1 Alberto, T.C., Lochter J.V., Almeida, T.A. Filtragem Automática de Spam nos Comentários do YouTube. Anais do XII Enc...
tensorflow/docs-l10n
site/zh-cn/guide/autodiff.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...
guyk1971/deep-learning
dcgan-svhn/DCGAN.ipynb
mit
%matplotlib inline import pickle as pkl import matplotlib.pyplot as plt import numpy as np from scipy.io import loadmat import tensorflow as tf !mkdir data """ Explanation: Deep Convolutional GANs In this notebook, you'll build a GAN using convolutional layers in the generator and discriminator. This is called a De...
Merinorus/adaisawesome
Homework/01 - Pandas and Data Wrangling/temp/Data Wrangling with Pandas.ipynb
gpl-3.0
%matplotlib inline import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns sns.set_context('notebook') """ Explanation: Table of Contents <p><div class="lev1"><a href="#Data-Wrangling-with-Pandas"><span class="toc-item-num">1&nbsp;&nbsp;</span>Data Wrangling with Pandas</a></div><d...
mne-tools/mne-tools.github.io
0.14/_downloads/plot_stats_cluster_spatio_temporal.ipynb
bsd-3-clause
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Eric Larson <larson.eric.d@gmail.com> # License: BSD (3-clause) import os.path as op import numpy as np from numpy.random import randn from scipy import stats as stats import mne from mne import (io, spatial_tris_connectivity, comput...
dsquareindia/gensim
docs/notebooks/Corpora_and_Vector_Spaces.ipynb
lgpl-2.1
import logging logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) """ Explanation: Tutorial 1: Corpora and Vector Spaces See this gensim tutorial on the web here. Don’t forget to set: End of explanation """ from gensim import corpora documents = ["Human machine interface for...
rishuatgithub/MLPy
nlp/UPDATED_NLP_COURSE/01-NLP-Python-Basics/04-Stop-Words.ipynb
apache-2.0
# Perform standard imports: import spacy nlp = spacy.load('en_core_web_sm') # Print the set of spaCy's default stop words (remember that sets are unordered): print(nlp.Defaults.stop_words) len(nlp.Defaults.stop_words) """ Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a> ...
jdhp-docs/python_notebooks
nb_dev_python/python_keras_1d_non-linear_regression.ipynb
mit
import tensorflow as tf tf.__version__ import keras keras.__version__ import h5py h5py.__version__ import pydot pydot.__version__ """ Explanation: Basic 1D non-linear regression with Keras TODO: see https://stackoverflow.com/questions/44998910/keras-model-to-fit-polynomial Install Keras https://keras.io/#installati...
spencer2211/deep-learning
seq2seq/sequence_to_sequence_implementation.ipynb
mit
import numpy as np import time import helper source_path = 'data/letters_source.txt' target_path = 'data/letters_target.txt' source_sentences = helper.load_data(source_path) target_sentences = helper.load_data(target_path) """ Explanation: Character Sequence to Sequence In this notebook, we'll build a model that ta...
ECP-CANDLE/Supervisor
workflows/cp1/scripts/cp1_scripts.ipynb
mit
df = pd.read_csv('~/Documents/results/cp1/non_nci_hpo_log/hpos.txt', sep="|", header=None, names=["i", "hpo_id", "params", "run_dir", "ts", "val_loss"]) df.groupby("hpo_id")['val_loss'].agg([np.min, np.max, np.mean, np.std]) n = 10 smallest = df.groupby('hpo_id')['val_loss'].nsmallest(n) best_n = df.iloc[smallest.in...
IanOlin/github-research
Unsupported/Affilliation/csvs/.ipynb_checkpoints/arrayify-checkpoint.ipynb
mit
importpath = "/home/jwb/repos/github-research/csvs/Companies/Ugly/Stack/" exportpath = "/home/jwb/repos/github-research/csvs/Companies/Pretty/Stack/" """ Explanation: Ugly To Pretty for CSVS Run on linux. Set an import path and an export path to folders. Will take every file in import directory that is a mathematica g...
dsiufl/2015-Fall-Hadoop
notes/.ipynb_checkpoints/1-hadoop-streaming-py-wordcount-checkpoint.ipynb
mit
hadoop_root = '/home/ubuntu/shortcourse/hadoop-2.7.1/' hadoop_start_hdfs_cmd = hadoop_root + 'sbin/start-dfs.sh' hadoop_stop_hdfs_cmd = hadoop_root + 'sbin/stop-dfs.sh' # start the hadoop distributed file system ! {hadoop_start_hdfs_cmd} # show the jave jvm process summary # You should see NamenNode, SecondaryNameNod...
TariqAHassan/BioVida
tutorials/1_openi.ipynb
bsd-3-clause
from biovida.images import OpeniInterface opi = OpeniInterface() """ Explanation: BioVida: Open-i Open-i is an open access biomedical search engine provided by the US National Institutes of Health. The service grants programmatic access to its over 1.2 million images through a RESTful web API. BioVida provides an ea...
cathywu/flow
tutorials/tutorial12_inflows.ipynb
mit
from flow.scenarios import MergeScenario """ Explanation: Tutorial 12: Inflows This tutorial walks you through the process of introducing inflows of vehicles into a network. Inflows allow us to simulate open networks where vehicles may enter (and potentially exit) the network consanstly, such as a section of a highway...
tpin3694/tpin3694.github.io
python/group_pandas_data_by_hour_of_the_day.ipynb
mit
# Import libraries import pandas as pd import numpy as np """ Explanation: Title: Group Pandas Data By Hour Of The Day Slug: group_pandas_data_by_hour_of_the_day Summary: Group data by hour of the day using pandas. Date: 2016-12-21 12:00 Category: Python Tags: Data Wrangling Authors: Chris Albon Preliminaries End of...
adamwang0705/cross_media_affect_analysis
develop/20171011-daheng-check_topics_basic_statistics.ipynb
mit
""" Initialization """ ''' Standard modules ''' import os import pickle import sqlite3 import time from pprint import pprint ''' Analysis modules ''' import pandas as pd ''' Custom modules ''' import config import utilities ''' Misc ''' nb_name = '20171011-daheng-check_topics_basic_statistics' """ Explanation: Ch...
ES-DOC/esdoc-jupyterhub
notebooks/awi/cmip6/models/sandbox-1/atmoschem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'awi', 'sandbox-1', 'atmoschem') """ Explanation: ES-DOC CMIP6 Model Properties - Atmoschem MIP Era: CMIP6 Institute: AWI Source ID: SANDBOX-1 Topic: Atmoschem Sub-Topics: Transport, Emissions Co...
jshudzina/keras-tutorial
notebooks/01-TensorPoisonousMushrooms.ipynb
apache-2.0
from pandas import read_csv srooms_df = read_csv('../data/agaricus-lepiota.data.csv') from sklearn_pandas import DataFrameMapper import sklearn import numpy as np mappings = ([ ('edibility', sklearn.preprocessing.LabelEncoder()), ('odor', sklearn.preprocessing.LabelBinarizer()), ('habitat', sklearn.preproc...
dnaneet/ELC
DATA/ELC_computable_report_AY1920.ipynb
gpl-3.0
#@title #%%capture import numpy as np #Linear algebra import pandas as pd #Time series, datetime object manipulation import matplotlib.pyplot as plt #plotting #import seaborn as sb #plt.style.use('fivethirtyeight') #Plot style preferred by author. import calendar from tabulate import tabulate #pretty display of table...
darkomen/TFG
modelado/temperatura/modelado.ipynb
cc0-1.0
#Importamos las librerías utilizadas import numpy as np import pandas as pd import seaborn as sns #Mostramos las versiones usadas de cada librerías print ("Numpy v{}".format(np.__version__)) print ("Pandas v{}".format(pd.__version__)) print ("Seaborn v{}".format(sns.__version__)) #Mostramos todos los gráficos en el n...
keras-team/keras-io
examples/vision/ipynb/edsr.ipynb
apache-2.0
import numpy as np import tensorflow as tf import tensorflow_datasets as tfds import matplotlib.pyplot as plt from tensorflow import keras from tensorflow.keras import layers AUTOTUNE = tf.data.AUTOTUNE """ Explanation: Enhanced Deep Residual Networks for single-image super-resolution Author: Gitesh Chawda<br> Date ...
google-research/google-research
dnn_predict_accuracy/colab/dnn_predict_accuracy.ipynb
apache-2.0
from __future__ import division import time import os import json import sys import numpy as np from matplotlib import pyplot as plt from matplotlib import colors import pandas as pd import seaborn as sns from scipy import stats from tensorflow import keras from tensorflow.io import gfile import lightgbm as lgb DATAF...
catalyst-cooperative/pudl
test/validate/notebooks/validate_gf_eia923.ipynb
mit
%load_ext autoreload %autoreload 2 import sys import pandas as pd import sqlalchemy as sa import pudl import warnings import logging logger = logging.getLogger() logger.setLevel(logging.INFO) handler = logging.StreamHandler(stream=sys.stdout) formatter = logging.Formatter('%(message)s') handler.setFormatter(formatter...
neeasthana/ML-SQL
ML-SQL/ML-SQL-initialDemo.ipynb
gpl-3.0
#Libraries #from pyparsing import Word, Literal, alphas, Optional, OneOrMore, Group, Or, Combine, oneOf from pyparsing import * import string import sys import pandas as pd from sklearn import svm from sklearn.linear_model import LogisticRegression from sklearn.cross_validation import train_test_split """ Explanation:...
ianhamilton117/deep-learning
sentiment-rnn/Sentiment_RNN.ipynb
mit
import numpy as np import tensorflow as tf with open('../sentiment-network/reviews.txt', 'r') as f: reviews = f.read() with open('../sentiment-network/labels.txt', 'r') as f: labels = f.read() reviews[:2000] """ Explanation: Sentiment Analysis with an RNN In this notebook, you'll implement a recurrent neural...
google/empirical_calibration
notebooks/kang_schafer_population_mean.ipynb
apache-2.0
#@title Copyright 2019 The Empirical Calibration Authors. # 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 l...
therealAJ/python-sandbox
data-science/learning/ud1/DataScience/SimilarMovies.ipynb
gpl-3.0
import pandas as pd r_cols = ['user_id', 'movie_id', 'rating'] ratings = pd.read_csv('e:/sundog-consult/udemy/datascience/ml-100k/u.data', sep='\t', names=r_cols, usecols=range(3)) m_cols = ['movie_id', 'title'] movies = pd.read_csv('e:/sundog-consult/udemy/datascience/ml-100k/u.item', sep='|', names=m_cols, usecols=...
liganega/Gongsu-DataSci
previous/notes2017/W10/GongSu22_Statistics_Population_Variance.ipynb
gpl-3.0
from GongSu21_Statistics_Averages import * """ Explanation: 자료 안내: 여기서 다루는 내용은 아래 사이트의 내용을 참고하여 생성되었음. https://github.com/rouseguy/intro2stats 모집단 분산 점추정 안내사항 지난 시간에 다룬 21장 내용을 활용하고자 한다. 따라서 아래와 같이 21장 내용을 모듈로 담고 있는 파이썬 파일을 임포트 해야 한다. 주의: GongSu21_Statistics_Averages.py 파일이 동일한 디렉토리에 있어야 한다. End of explanation """ p...
etpinard/delightfulsoup
examples/ipython-notebook/notebook.ipynb
mit
import plotly plotly.__version__ """ Explanation: Plotly maps with Plotly's Python API library and Basemap This notebook comes in response to <a href="https://twitter.com/rjallain/status/496767038782570496" target="_blank">this</a> Rhett Allain tweet. Although Plotly does not feature built-in maps functionality (yet)...
gaufung/ISL
training-materials/Stasmodels-training/Regrssion Diagnostics.ipynb
mit
from statsmodels.compat import lzip import statsmodels import numpy as np import pandas as pd import statsmodels.formula.api as smf import statsmodels.stats.api as sms import matplotlib.pyplot as plt # Load data url = 'http://vincentarelbundock.github.io/Rdatasets/csv/HistData/Guerry.csv' dat = pd.read_csv(url) # Fit...
peastman/deepchem
examples/tutorials/The_Basic_Tools_of_the_Deep_Life_Sciences.ipynb
mit
!pip install --pre deepchem """ Explanation: The Basic Tools of the Deep Life Sciences Welcome to DeepChem's introductory tutorial for the deep life sciences. This series of notebooks is a step-by-step guide for you to get to know the new tools and techniques needed to do deep learning for the life sciences. We'll sta...
flowersteam/naminggamesal
notebooks/5_Intro_Experiment.ipynb
agpl-3.0
import naminggamesal.ngsimu as ngsimu """ Explanation: Experiments End of explanation """ xp_cfg={ 'pop_cfg':{ 'voc_cfg':{ 'voc_type':'matrix', 'M':5, 'W':10 }, 'strat_cfg':{ 'strat_type':'success_threshold', 'voc_update':'Mi...
jeffzhengye/pylearn
.ipynb_checkpoints/jpx-tokyo-simple-lstm-network-scuec-checkpoint.ipynb
unlicense
# check gpu env with torch import torch print(torch.__version__) # 查看torch当前版本号 print(torch.version.cuda) # 编译当前版本的torch使用的cuda版本号 print("is_cuda_available:", torch.cuda.is_available()) # 查看当前cuda是否可用于当前版本的Torch,如果输出 print('gpu count:', torch.cuda.device_count()) # 查看指定GPU的容量、名称 device = "cuda:0" print(f"{devic...
microsoft/dowhy
docs/source/example_notebooks/load_graph_example.ipynb
mit
import os, sys import random sys.path.append(os.path.abspath("../../../")) import numpy as np import pandas as pd import dowhy from dowhy import CausalModel from IPython.display import Image, display """ Explanation: Different ways to load an input graph We recommend using the GML graph format to load a graph. You c...
mwcraig/reducer
reducer/reducer-template.ipynb
bsd-3-clause
import reducer.gui import reducer.astro_gui as astro_gui from reducer.image_browser import ImageBrowser from ccdproc import ImageFileCollection from reducer import __version__ print(__version__) """ Explanation: Reducer: (Put your name here) Reviewer: (Put your name here) jupyter notebook crash course Click on a cod...
bjodah/aqchem
examples/kinetics_cstr.ipynb
bsd-2-clause
from collections import defaultdict import numpy as np from IPython.display import Latex import matplotlib.pyplot as plt from pyodesys.symbolic import SymbolicSys from chempy import Substance, ReactionSystem from chempy.kinetics.ode import get_odesys from chempy.units import SI_base_registry, default_units as u from ch...
mdda/pycon.sg-2015_deep-learning
ipynb/blocks-introduction-mnist.ipynb
mit
from theano import tensor x = tensor.matrix('features') """ Explanation: Introduction tutorial In this tutorial we will perform handwriting recognition by training a multilayer perceptron (MLP) on the MNIST handwritten digit database. The Task MNIST is a dataset which consists of 70,000 handwritten digits. Each digit...
zoofIO/flexx-notebooks
flexx_tutorial_event.ipynb
bsd-3-clause
%gui asyncio from flexx import event """ Explanation: Tutorial for flexx.event - properties and events End of explanation """ class MyObject(event.Component): @event.reaction('!foo') def on_foo(self, *events): print('received the foo event %i times' % len(events)) ob = MyObject() for i in rang...
dwhswenson/openpathsampling
examples/tests/test_snapshot.ipynb
mit
from __future__ import print_function import numpy as np import openpathsampling as paths import openpathsampling.engines.features as features """ Explanation: Some testing and analysis of the new Snapshot implementation End of explanation """ from IPython.display import Markdown def code_to_md(snapshot_class): ...
gwu-libraries/notebooks
20181127-top-hashtags-json.ipynb
mit
!cat 50tweets.json | jq -cr '[.entities.hashtags][0][].text' !cat tweets4hashtags.json | jq -cr '[.entities.hashtags][0][].text' > allhashtags.txt """ Explanation: Computing the top hashtags (JSON) So you have tweets in a JSON file, and you'd like to get a list of the hashtags, from the most frequently occurring hash...
MTG/essentia
src/examples/python/musicbricks-tutorials/1-stft_analsynth.ipynb
agpl-3.0
# import essentia in streaming mode import essentia import essentia.streaming as es """ Explanation: STFT Analysis/Synthesis - MusicBricks Tutorial Introduction This tutorial will guide you through some tools for performing spectral analysis and synthesis using the Essentia library (http://www.essentia.upf.edu). STFT ...
ES-DOC/esdoc-jupyterhub
notebooks/ipsl/cmip6/models/sandbox-1/ocean.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'ipsl', 'sandbox-1', 'ocean') """ Explanation: ES-DOC CMIP6 Model Properties - Ocean MIP Era: CMIP6 Institute: IPSL Source ID: SANDBOX-1 Topic: Ocean Sub-Topics: Timestepping Framework, Advection...
jvcarr/portfolio
projects/West-Nile-Final.ipynb
mit
import pandas as pd import matplotlib.pyplot as plt from sklearn.preprocessing import LabelEncoder from sklearn.cross_validation import cross_val_score, StratifiedKFold , train_test_split from sklearn.metrics import accuracy_score, confusion_matrix, classification_report, roc_curve, auc from sklearn.ensemble import Ra...
Intel-Corporation/tensorflow
tensorflow/lite/g3doc/tutorials/model_maker_speech_recognition.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...
royalosyin/Python-Practical-Application-on-Climate-Variability-Studies
ex26-Identify Marine Heatwaves from High-resolution Daily SST Data.ipynb
mit
%matplotlib inline import numpy as np from datetime import date from matplotlib import pyplot as plt # Load marineHeatWaves definition module import marineHeatWaves as mhw """ Explanation: Identify Marine Heatwaves from High-resolution Daily SST Data Marine ecosystems are strongly influenced by heatwaves, a kind of ...
bashtage/statsmodels
examples/notebooks/statespace_fixed_params.ipynb
bsd-3-clause
%matplotlib inline from importlib import reload import numpy as np import pandas as pd import statsmodels.api as sm import matplotlib.pyplot as plt from pandas_datareader.data import DataReader """ Explanation: Estimating or specifying parameters in state space models In this notebook we show how to fix specific val...
hesam-setareh/nest-simulator
pynest/examples/gif_pop_psc_exp.ipynb
gpl-2.0
%matplotlib inline import matplotlib import numpy as np import matplotlib.pyplot as plt import nest """ Explanation: Population rate model of generalized integrate-and-fire neurons This script simulates a finite network of generalized integrate-and-fire (GIF) neurons directly on the mesoscopic population level using ...
QuantScientist/Deep-Learning-Boot-Camp
day03/2.3 Deep Convolutional Neural Networks.ipynb
mit
from keras.applications import VGG16 from keras.applications.imagenet_utils import preprocess_input, decode_predictions import os # -- Jupyter/IPython way to see documentation # please focus on parameters (e.g. include top) VGG16?? vgg16 = VGG16(include_top=True, weights='imagenet') """ Explanation: Deep CNN Models ...
sdss/marvin
docs/sphinx/jupyter/Shanghai_Demo_Tools.ipynb
bsd-3-clause
from __future__ import print_function, division, absolute_import import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Marvin Workshop (Shanghai 2016) This Jupyter notebook will guide you through the installation of Marvin and will give you a hint of its capabilities. But enough talk, let's begin by inst...
kit-cel/lecture-examples
mloc/ch4_Deep_Learning/pytorch/pytorch_tutorial_2.ipynb
gpl-2.0
import torch import numpy as np %matplotlib inline import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt from IPython import display device = 'cuda' if torch.cuda.is_available() else 'cpu' print("We are using the following device for learning:",device) """ Explanation: PyTorch Tutorial - Part 2 T...
Kaggle/learntools
notebooks/intro_to_programming/raw/ex5.ipynb
apache-2.0
from learntools.core import binder binder.bind(globals()) from learntools.intro_to_programming.ex5 import * print('Setup complete.') """ Explanation: In the tutorial, you learned how to define and modify Python lists. In this exercise, you will use your new knowledge to solve several problems. Set up the notebook Run...
dereneaton/ipyrad
tests/cookbook-bucky.ipynb
gpl-3.0
## conda install -c BioBuilds mrbayes ## conda install -c ipyrad ipyrad ## conda install -c ipyrad bucky ## import Python libraries import ipyrad.analysis as ipa import ipyparallel as ipp """ Explanation: Cookbook for running BUCKy in parallel in a Jupyter notebook This notebook uses the Pedicularis example data set ...
ababino/circles_metacog
circles_metacog_analysis.ipynb
mit
%matplotlib inline from __future__ import unicode_literals import pandas as pd import numpy as np from glob import glob from matplotlib import pyplot as plt import seaborn as sns from metacog_utils import add_sdt_utils, metacog_dfs, jointplot_group from IPython.display import display """ Explanation: Circles Metacog A...
matthias-k/pysaliency-examples
notebooks/Demo_Saliency_Maps.ipynb
mit
import pysaliency import pysaliency.external_datasets data_location = 'cache/datasets' mit_stimuli, mit_fixations = pysaliency.external_datasets.get_mit1003(location=data_location) index = 0 plt.imshow(mit_stimuli.stimuli[index]) f = mit_fixations[mit_fixations.n == index] plt.scatter(f.x, f.y, color='r') _ = plt.ax...
ethanrowe/flowz
userguide/02. Intro to Artifacts.ipynb
mit
# An ExtantArtifact that will be used here and elsewhere in the guide class GuideExtantArtifact(ExtantArtifact): def __init__(self, num): super(GuideExtantArtifact, self).__init__(self.get_me, name='GuideExtantArtifact') self.num = num @gen.coroutine def get_me(self): # O, pardon! s...
arne-cl/alt-mulig
python/rstdt-lisp-import-test.ipynb
gpl-3.0
import os import sys import glob import nltk RSTDT_MAIN_ROOT = os.path.expanduser('~/repos/rst_discourse_treebank/data/RSTtrees-WSJ-main-1.0') RSTDT_DOUBLE_ROOT = os.path.expanduser('~/repos/rst_discourse_treebank/data/RSTtrees-WSJ-double-1.0') RSTDT_TOKENIZED_ROOT = os.path.expanduser('~/repos/rst_discourse_treebank...
antonpetkoff/learning
information-retreival/2018_10_08_inverted_index.ipynb
gpl-3.0
sample_bbc_news_sentences = [ "China confirms Interpol chief detained", "Turkish officials believe the Washington Post writer was killed in the Saudi consulate in Istanbul.", "US wedding limousine crash kills 20", "Bulgarian journalist killed in park", "Kanye West deletes social media profiles", ...
rajul/tvb-library
tvb/simulator/demos/region_deterministic_smooth_parameter_variation.ipynb
gpl-2.0
from tvb.simulator.lab import * """ Explanation: Demonstrate using the simulator at the region level, deterministic integration, how to smoothly change a model parameter at run time. Run Time ~ 3 seconds End of explanation """ #rs.configure() LOG.info("Configuring...") #Initialise a Model, Coupling, and Connectivit...
Pittsburgh-NEH-Institute/Institute-Materials-2017
schedule/week_2/Near_matching.ipynb
gpl-3.0
from collatex import * collation = Collation() collation.add_plain_witness("A", "The gray koala") collation.add_plain_witness("B", "The big grey koala") alignment_table = collate(collation, segmentation=False) print(alignment_table) from collatex import * collation = Collation() collation.add_plain_witness("A", "The g...
sharefm/DSF
project.ipynb
gpl-3.0
import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt from collections import Counter %matplotlib inline """ Explanation: Project for Data Science Fundamentals course Loay Abdulatif & Sharef Mustafa The Question that we are investigating is that: Who are the attackers of a websit...
ethen8181/machine-learning
data_science_is_software/notebooks/data_science_is_software.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) """ Explanation: <h1>T...
matthewzimmer/traffic-sign-classification
plotting/matplotlib/plotting.ipynb
mit
x = linspace(0, 5, 10) y = x ** 2 figure() plot(x, y, 'r') xlabel('x') ylabel('y') title('title') plot() """ Explanation: plot example End of explanation """ from __future__ import division from IPython.display import display from sympy.interactive import printing printing.init_printing(use_latex='mathjax') impor...
tommyogden/maxwellbloch
docs/examples/mbs-lambda-weak-pulse-more-atoms-with-coupling.ipynb
mit
mb_solve_json = """ { "atom": { "fields": [ { "coupled_levels": [[0, 1]], "detuning": 0.0, "detuning_positive": true, "label": "probe", "rabi_freq": 1.0e-3, "rabi_freq_t_args": { "ampl": 1.0, "centre": 0.0, "fw...
mathcoding/programming
notebooks_v3/Lab1_Introduzione.v3.ipynb
mit
345 """ Explanation: Elementi di Programmazione Un linguaggio di programmazione serve sia per istruire una macchina ad eseguire dei conti, che per organizzare le nostre idee su come quei conti devono essere eseguiti. Per questo, nella scelta di un linguaggio di programmazione, dobbiamo tener presente quali sono gli st...
yashdeeph709/Algorithms
PythonBootCamp/Complete-Python-Bootcamp-master/List Comprehensions.ipynb
apache-2.0
# Grab every letter in string lst = [x for x in 'word'] # Check lst """ Explanation: Comprehensions In addition to sequence operations and list methods, Python includes a more advanced operation called a list comprehension. List comprehensions allow us to build out lists using a different notation. You can think of i...
garibaldu/boundary-seekers
boundary-seeker.ipynb
mit
def sigmoid(phi): return 1.0/(1.0 + np.exp(-phi)) def calc_prob_class1(params): # Sigmoid perceptron ('logistic regression') tildex = X - params['mean'] W = params['wgts'] phi = np.dot(tildex, W) return sigmoid(phi) # Sigmoid perceptron ('logistic regression') def calc_membership(params): ...
AdityaSoni19031997/Machine-Learning
Coursera_DL/Python+Basics+With+Numpy+v3.ipynb
mit
### START CODE HERE ### (≈ 1 line of code) test = 'Hello World' ### END CODE HERE ### print ("test: " + test) """ Explanation: Python Basics with Numpy (optional assignment) Welcome to your first assignment. This exercise gives you a brief introduction to Python. Even if you've used Python before, this will help fami...
delsner/dl-exploration
notebooks/04 - Backpropagation .ipynb
mit
import numpy as np from matplotlib import pyplot as plt """ Explanation: Backpropagation This is meant to deepen the understanding of backpropagation and (stochastic) gradient descent in NN. Softmax Linear Classifier Initially a linear classifier, then move to 2-layer NN. End of explanation """ # Generate a spiral d...
spatialaudio/sweep
software_sweep.ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt """ Explanation: Simulation of Impulse Response Measurements The software (https://github.com/franzpl/sweep) has been written in the context of my bachelor thesis with the topic "On the influence of windowing of sweep signals for room impulse measur...
danielbultrini/FXFEL
Particle Distribution Visualization.ipynb
bsd-3-clause
import processing_tools as pt """ Explanation: First, import the processing tools that contain classes and methods to read, plot and process standard unit particle distribution files. End of explanation """ filepath = './example/example.h5' data = pt.ParticleDistribution(filepath) data.su2si data.dict['x'] """ Ex...
danielfrg/danielfrg.github.io-source
content/blog/notebooks/2016/02/ssn-names.ipynb
apache-2.0
%matplotlib inline import pandas as pd import os data_dir = os.path.expanduser("~/data/names/names") files = os.listdir(data_dir) data = pd.DataFrame(columns=["year", "name", "sex", "occurrences"]) for fname in files: if fname.endswith(".txt"): fpath = os.path.join(data_dir, fname) df = pd.rea...
coursemdetw/reveal2
content/notebook/Elements of Evolutionary Algorithms.ipynb
mit
import random from deap import algorithms, base, creator, tools creator.create("FitnessMax", base.Fitness, weights=(1.0,)) creator.create("Individual", list, fitness=creator.FitnessMax) def evalOneMax(individual): return (sum(individual),) """ Explanation: <img src='http://www.puc-rio.br/sobrepuc/admin/vrd/brasa...
jupyter/nbgrader
nbgrader/docs/source/user_guide/autograded/hacker/ps1/problem1.ipynb
bsd-3-clause
NAME = "Alyssa P. Hacker" COLLABORATORS = "Ben Bitdiddle" """ Explanation: Before you turn this problem in, make sure everything runs as expected. First, restart the kernel (in the menubar, select Kernel$\rightarrow$Restart) and then run all cells (in the menubar, select Cell$\rightarrow$Run All). Make sure you fill i...
Merinorus/adaisawesome
Homework/05 - Taming Text/HW05_awesometeam_Q2.ipynb
gpl-3.0
import pandas as pd import pycountry from nltk.sentiment import * import numpy as np import matplotlib.pyplot as plt import codecs import math import re import string """ Explanation: Question 2) Find all the mentions of world countries in the whole corpus, using the pycountry utility (HINT: remember that there wil...
iagapov/ocelot
demos/ipython_tutorials/4_wake.ipynb
gpl-3.0
# the output of plotting commands is displayed inline within frontends, # directly below the code cell that produced it %matplotlib inline # this python library provides generic shallow (copy) and deep copy (deepcopy) operations from copy import deepcopy import time # import from Ocelot main modules and functions f...
ireapps/cfj-2017
completed/00. Python Fundamentals (Part 1).ipynb
mit
# variable assignment # https://www.digitalocean.com/community/tutorials/how-to-use-variables-in-python-3 # strings -- enclose in single or double quotes, just make sure they match my_name = 'Cody' # numbers int_num = 6 float_num = 6.4 # the print function print(8) print('Hello!') print(my_name) print(int_num) print...
ageron/ml-notebooks
06_decision_trees.ipynb
apache-2.0
# To support both python 2 and python 3 from __future__ import division, print_function, unicode_literals # Common imports import numpy as np import os # to make this notebook's output stable across runs np.random.seed(42) # To plot pretty figures %matplotlib inline import matplotlib as mpl import matplotlib.pyplot ...
phoebe-project/phoebe2-docs
development/tutorials/l3.ipynb
gpl-3.0
#!pip install -I "phoebe>=2.4,<2.5" """ Explanation: "Third" Light Setup Let's first make sure we have the latest version of PHOEBE 2.4 installed (uncomment this line if running in an online notebook session such as colab). End of explanation """ import phoebe from phoebe import u # units import numpy as np import m...
Esri/gis-stat-analysis-py-tutor
notebooks/NeighborhoodSearching.ipynb
apache-2.0
import Weights as WEIGHTS import os as OS inputFC = r'../data/CA_Polygons.shp' fullFC = OS.path.abspath(inputFC) fullPath, fcName = OS.path.split(fullFC) masterField = "MYID" """ Explanation: Neighborhood Structures in the ArcGIS Spatial Statistics Library Spatial Weights Matrix On-the-fly Neighborhood Iterators [GA ...
tpin3694/tpin3694.github.io
machine-learning/calculate_the_trace_of_a_matrix.ipynb
mit
# Load library import numpy as np """ Explanation: Title: Calculate The Trace Of A Matrix Slug: calculate_the_trace_of_a_matrix Summary: How to calculate the trace of a matrix in Python. Date: 2017-09-02 12:00 Category: Machine Learning Tags: Vectors Matrices Arrays Authors: Chris Albon Preliminaries End of ex...
fdmazzone/Ecuaciones_Diferenciales
Teoria_Basica/scripts/Segundo Parcial 2015.ipynb
gpl-2.0
from sympy import * init_printing() x,y=symbols('x,y') u=y*x**2-x**2/y**2 (x*u.diff(x)+y*u.diff(y)).simplify() u.subs(y,1) """ Explanation: Ejercicio 1 Resolver el siguiente problema de valores iniciales para una ecuación en derivadas parciales $$x\frac{\partial u}{\partial x}+y\frac{\partial u}{\partial y}=3x^2y$$ $...
gfeiden/Notebook
Projects/senap/common_blocks.ipynb
mit
import fileinput as fi """ Explanation: MARCS Common Blocks Identifying Fortran common blocks used throughout the MARCS model atmosphere package. The goal is to have a list of common blocks with an index of each routine they appear in. End of explanation """ !head -n 5 marcs_common_blocks.txt """ Explanation: I hav...
Krastanov/cutiepy
examples/Schroedinger_Equation_Solver_Examples-with_code.ipynb
bsd-3-clause
from cutiepy import * %matplotlib inline import matplotlib.pyplot as plt import numpy as np cutiepy.codegen.DEBUG = True """ Explanation: Table of Contents Rabi Oscillations Simulating the Full Hamiltonian With Rotating Wave Approximation Coherent State in a Harmonic Oscillator Jaynes-Cummings Revival Definite Phot...
google/eng-edu
ml/pc/exercises/image_classification_part2.ipynb
apache-2.0
# 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 the L...
kfollette/AST337-Fall2017
Labs/Lab6/Lab6.ipynb
mit
# The standard fare: import numpy as np import matplotlib.pyplot as plt import pandas as pd %matplotlib inline # Recall our use of this module to work with FITS files in Lab 4: from astropy.io import fits # This lets us use various Unix (or Unix-like) commands within Python: import os # We will see what this does ...
mamrehn/machine-learning-tutorials
ipynb/[tinydb] First steps.ipynb
cc0-1.0
path = './testData.json' from tinydb import TinyDB, where db = TinyDB(path) """ Explanation: TinyDB TinyDB is a small and lightweight NoSQL database framework based on simple JSON files. Source Official Website: - getting started - advanced usage Code Some examples to create a database and insert, delete and seach for...
rishuatgithub/MLPy
nlp/UPDATED_NLP_COURSE/01-NLP-Python-Basics/01-Tokenization.ipynb
apache-2.0
# Import spaCy and load the language library import spacy nlp = spacy.load('en_core_web_sm') # Create a string that includes opening and closing quotation marks mystring = '"We\'re moving to L.A.!"' print(mystring) # Create a Doc object and explore tokens doc = nlp(mystring) for token in doc: print(token.text, e...
anandha2017/udacity
nd101 Deep Learning Nanodegree Foundation/DockerImages/20_transfer_learning/notebooks/transfer-learning/Transfer_Learning.ipynb
mit
from urllib.request import urlretrieve from os.path import isfile, isdir from tqdm import tqdm vgg_dir = 'tensorflow_vgg/' # Make sure vgg exists if not isdir(vgg_dir): raise Exception("VGG directory doesn't exist!") class DLProgress(tqdm): last_block = 0 def hook(self, block_num=1, block_size=1, total_...
JrtPec/opengrid
notebooks/Demo/Demo_caching.ipynb
apache-2.0
import pandas as pd from opengrid.library import misc from opengrid.library import houseprint from opengrid.library import caching import charts hp = houseprint.Houseprint() """ Explanation: Demo caching This notebook shows how caching of daily results is organised. First we show the low-level approach, then a high-le...
Mahdisadjadi/phoenixcrime
map.ipynb
mit
import shapefile import matplotlib.patches as patches from matplotlib.collections import PatchCollection import matplotlib.pyplot as plt import pandas as pd import numpy as np %matplotlib inline """ Explanation: Inspired by this gist! To get data from go to this website: http://www.census.gov/cgi-bin/geo/shapefiles201...
tensorflow/docs
site/en/guide/migrate/tensorboard.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...
BDannowitz/polymath-progression-blog
jlab-ml-lunch-2/notebooks/02-Recommender-System-Surprise.ipynb
gpl-2.0
import pandas as pd from surprise import Dataset, Reader from surprise.model_selection import cross_validate from sklearn.preprocessing import MinMaxScaler, StandardScaler from jlab import load_test_data, get_test_detector_plane """ Explanation: 02 - Surprise Recommender System Use a well-supported recommender packag...