text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
# Monkey Bread ``` from SpectralCV import ecog_pipe as ep import numpy as np import scipy as sp import scipy.io as io import scipy.signal as sig import math as math import random from scipy import integrate import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D %matplotlib inline plt.style.use('seabo...
github_jupyter
``` import sklearn import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import numpy as np from sklearn.model_selection import train_test_split from sklearn.linear_model import LinearRegression, LogisticRegression, Lasso from sklearn import svm from sklearn.metrics import mean_squared_error, accura...
github_jupyter
<div class="alert alert-block alert-info"> Section of the book chapter: <b>5.2.2 Active Learning</b> </div> # 4. Active learning **Table of Contents** * [4.1 Active Learning Setup](#4.1-Active-Learning-Setup) * [4.2 Initial Estimation](#4.2-Initial-Estimation) * [4.3 Including Active Learning](#4.3-Including-Active-...
github_jupyter
``` import os import random import torch import numpy as np from torch.nn import functional as F dataset_dir = "./family/" all_trip_file = os.path.join(dataset_dir, "all.txt") relations_file = os.path.join(dataset_dir, "relations.txt") entities_file = os.path.join(dataset_dir, "entities.txt") def read_xxx_to_id(file_p...
github_jupyter
##### Copyright 2021 The TF-Agents Authors. ``` #@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 a...
github_jupyter
<a href="https://colab.research.google.com/github/henrywoo/MyML/blob/master/Copy_of_nlu_1.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> #### Copyright 2018 Google LLC. ``` # Licensed under the Apache License, Version 2.0 (the "License"); # you ma...
github_jupyter
<a href="https://colab.research.google.com/github/AryanMethil/Brain_Tumor_Detection/blob/master/constants.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Folders Details : **brain_tumor_dataset => Input Dataset which also contains the test dataset...
github_jupyter
``` import tensorflow as tf import tensorflow.contrib.slim as slim import numpy as np import os from scipy.misc import imread,imresize from random import shuffle from sklearn.preprocessing import LabelEncoder tf.__version__ ``` Make sure you download this data and extract in the same directory, https://drive.google.c...
github_jupyter
``` import sys sys.path.append("/remote-home/xtzhang/CTC/CTC2021/SpecialEdition") import os import random import time import logging import argparse from dataclasses import dataclass, field from typing import Optional,Dict, Union, Any, Tuple, List import numpy as np import datasets import torch import torch.nn as nn ...
github_jupyter
# Notebook-10: Wrapping Up (A Matter of Style) ### Lesson Content - Style - Why style matters - Python style - Why??? - Why did I enter this world of pain? - Where am I going? Welcome to the ninth, and currently _last_, Code Camp notebook! In this lesson we'll cover a number of things that don't fit...
github_jupyter
<img src="imgs/dh_logo.png" align="right" width="50%"> # Aula 3.5.2 - Clustering Fala galera! Tudo bem? Hoje continuaremos a aula de clustering/unsupervised learning. Na aula passada, vimos os conceitos básicos de clustering, bem como o algoritmo mais simples para a tarefa (simples, porém muito eficiente em vários c...
github_jupyter
# Data Processing - Overview ## Pre-requisites and Module Introduction Let us understand prerequisites before getting into the module. * Good understanding of Data Processing using Python. * Data Processing Life Cycle * Reading Data from files * Processing Data using APIs * Writing Processed Data back to files * W...
github_jupyter
# Python (EPAM, 2020), lecture 11 # Section 0. Metaclasses one more time ```python class DisallowPublicClassAttributes(type): # is a metaclass def __new__(cls, name, bases, dct): cls_instance = super().__new__(cls, name, bases, dct) if any([not key.startswith("_") for key in dct.keys()]): ...
github_jupyter
# Example Data ``` import os def mkfile(filename, body=None): with open(filename, 'w') as f: f.write(body or filename) return def make_example_dir(top): if not os.path.exists(top): os.mkdir(top) curdir = os.getcwd() os.chdir(top) os.mkdir('dir1') os.mkdir('dir2') m...
github_jupyter
# Plots > Plotting is everything! Here we provide the code to process the results as they come from the examples in the benchmarking and transfer learning notebooks. The plots have the same format as the ones in the paper. ``` from bounce.hamiltonian import XXHamiltonian from bounce.utils import save_benchmark, load_...
github_jupyter
``` from math import * seed = (0,0) length = 100 minlength = 10 ratio = sqrt(2) vertical = True queue = [(seed,length,vertical)] def makelines(lines,queue,ratio): pt,length, vertical = queue.pop(0) print("length:",length) if length>minlength: if vertical: A = (pt[0],pt[1]+length/2.0) ...
github_jupyter
``` // #r ".\binaries\bossspad.dll" // #r ".\binaries\XNSEC.dll" #r "C:\BoSSS\experimental\public\src\L4-application\BoSSSpad\bin\Release\net5.0\bossspad.dll" #r "C:\BoSSS\experimental\public\src\L4-application\BoSSSpad\bin\Release\net5.0\XNSEC.dll" // #r "C:\BoSSS\experimental\public\src\L4-application\BoSSSpad\bin\R...
github_jupyter
<a href="https://colab.research.google.com/github/simecek/dspracticum2020/blob/master/lecture_02/01_one_neuron_and_MPG_dataset.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` import matplotlib.pyplot as plt import numpy as np import pandas as pd...
github_jupyter
<!--BOOK_INFORMATION--> <img align="left" style="padding-right:10px;" src="figures/PDSH-cover-small.png"> *This notebook contains an excerpt from the [Python Data Science Handbook](http://shop.oreilly.com/product/0636920034919.do) by Jake VanderPlas; the content is available [on GitHub](https://github.com/jakevdp/Pyth...
github_jupyter
📍 **Project Title** : Digit Recognizer Project 📍 **Aim of the Project** : This project will classify different digits and predict accordingly. 📍 **Dataset** : https://www.kaggle.com/c/digit-recognizer/data 📍 **Libraries used :** ```Numpy, Pandas, Matplotlib, Seaborn, Tensorflow, Keras``` ***********************...
github_jupyter
# Experiment: Presidential Campaigns Ads Dataset - Feature Extraction - This notebook shows how to use cloud services using REST API to convert audio to text, to analyze the extracted text and frames contents. Using the files previously collected (see Experiment: Presidential Campaigns Ads Dataset - Data Collection -...
github_jupyter
``` import time from collections import OrderedDict, namedtuple import numpy as np from numpy import linspace from pandas import DataFrame from scipy.integrate import odeint, ode import ggplot as gg %autosave 600 HAS_SOLVEIVP = False try: from scipy.integrate import solve_ivp HAS_SOLVEIVP = True except: pas...
github_jupyter
``` %matplotlib inline import matplotlib import matplotlib.pyplot as plt import numpy as np import random import os import copy import json import scipy # Detectron colors _COLORS = np.array([ 0.000, 0.447, 0.741, 0.850, 0.325, 0.098, 0.929, 0.694, 0.125, 0.494, 0.184, 0.556, 0.466, 0.674, 0.188 ]...
github_jupyter
# "Statistical Thinking in Python (Part 1)" > "Building the foundation you need to think statistically, speak the language of your data, and understand what your data is telling you." - toc: true - comments: true - author: Victor Omondi - categories: [statistical-thinking, eda, data-science] - image: images/statistic...
github_jupyter
``` %load_ext autoreload %autoreload 2 import sys sys.path.append('../scripts') import numpy as np import os, h5py import pandas as pd import variant_effect # read df and add strand all_dfs = [] cagi_data = '../data/CAGI/' combined_filename = '../data/combined_cagi.bed' for filename in os.listdir(cagi_data): prefix...
github_jupyter
# TorchDyn Quickstart **TorchDyn is the toolkit for continuous models in PyTorch. Play with state-of-the-art architectures or use its powerful libraries to create your own.** Central to the `torchdyn` approach are continuous neural networks, where *width*, *depth* (or both) are taken to their infinite limit. On the ...
github_jupyter
``` import os from enum import Enum import gzip import time import numpy as np from scipy.sparse import dok_matrix, csr_matrix import tensorflow as tf # Attalos Imports import attalos.util.log.log as l from attalos.dataset.dataset import Dataset from attalos.evaluation.evaluation import Evaluation # Local models fro...
github_jupyter
# Setup ``` # Python 3 compatability from __future__ import division, print_function # system functions that are always useful to have import time, sys, os # basic numeric setup import numpy as np import math from numpy import linalg import scipy from scipy import stats # plotting import matplotlib from matplotlib ...
github_jupyter
<h1> Polynomial Regression This cell is regarding polynomial regression, first we will grab the dataset and clean it a little bit. ``` import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.pipeline import Pipeline from sklearn.preprocessing import PolynomialFeatures from sklearn.linear_m...
github_jupyter
# 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 written with Numpy, we'll be using [TFLearn](http://tflearn.org/), a high-level library built on top of TensorFlow. TFLearn makes it simpler...
github_jupyter
### Cleaning data associated with bills: utterances, summaries; so they are ready for input to pointer-gen model - this is the new cleaning method implementation There are 6541 BIDs which overlap between the utterances and summaries datasets (using all the summary data). There are 359 instances in which the summaries ...
github_jupyter
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/configuration.png) # Configuration _**Setting up your Azure Machine Learning services workspace and configuring your n...
github_jupyter
# End-to-End Incremental Training Image Classification Example 1. [Introduction](#Introduction) 2. [Prerequisites and Preprocessing](#Prequisites-and-Preprocessing) 1. [Permissions and environment variables](#Permissions-and-environment-variables) 2. [Prepare the data](#Prepare-the-data) 3. [Training the model](#Tr...
github_jupyter
# Variable transformers : YeoJohnsonTransformer The YeoJohnsonTransformer() applies the Yeo-Johnson transformation to the numerical variables. **For this demonstration, we use the Ames House Prices dataset produced by Professor Dean De Cock:** Dean De Cock (2011) Ames, Iowa: Alternative to the Boston Housing Data as...
github_jupyter
## Preprocessing Tabular Data The purpose of this notebook is to demonstrate how to preprocess tabular data for training a machine learning model via Amazon SageMaker. In this notebook we focus on preprocessing our tabular data and in a sequel notebook, [training_model_on_tabular_data.ipynb](training_model_on_tabular_...
github_jupyter
``` from keras.datasets import fashion_mnist (train_X,train_Y), (test_X,test_Y) = fashion_mnist.load_data() import numpy as np from keras.utils import to_categorical import matplotlib.pyplot as plt %matplotlib inline print('Training data shape: ', train_X.shape, train_Y.shape) print('Testing data shape: ', test_X.shap...
github_jupyter
# All ## Set Up ``` print("Installing dependencies...") %tensorflow_version 2.x !pip install -q t5 import functools import os import time import warnings warnings.filterwarnings("ignore", category=DeprecationWarning) import tensorflow.compat.v1 as tf import tensorflow_datasets as tfds import t5 ``` ## Set UP TPU ...
github_jupyter
# Loops and Conditionals --- ## Loops - for - while **looping through list** *lets create a list* ``` lst = [1, 3, 4] for item in lst: print(item) print('='*3) ``` **Note: blocks** ``` print('Length of the list: ', len(lst)) for item in lst: print(item) print('='*3) print('Finished......') ``` ...
github_jupyter
``` from datascience import * import matplotlib.pyplot as plt %matplotlib inline import numpy as np import pandas as pd from utils import * plt.style.use('seaborn-muted') from matplotlib import patches import csaps import warnings warnings.filterwarnings("ignore") ``` # An Empirical Example from EEP 147 Let's take a ...
github_jupyter
# Clustering of Social Groups Using Census Demographic Variables #### Purpose of this notebook - 1) Use scikit-learn K-Means to create social groups across Toronto, Vancouver, Montreal #### Data Sources - Census Variables: https://www12.statcan.gc.ca/census-recensement/2016/dp-pd/prof/details/download-telecharger/com...
github_jupyter
Intro To Python ===== In this notebook, we will explore basic Python: - data types, including dictionaries - functions - loops Please note that we are using Python 3. (__NOT__ Python 2! Python 2 has some different functions and syntax) ``` # Let's make sure we are using Python 3 import sys print(sys.version[0]...
github_jupyter
<a href="https://colab.research.google.com/gist/adaamko/0161526d638e1877f7b649b3fff8f3de/deep-learning-practical-lesson.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Natural Language Processing and Information Extraction ## Deep learning - pract...
github_jupyter
# T81-558: Applications of Deep Neural Networks **Module 11: Natural Language Processing and Speech Recognition** * Instructor: [Jeff Heaton](https://sites.wustl.edu/jeffheaton/), McKelvey School of Engineering, [Washington University in St. Louis](https://engineering.wustl.edu/Programs/Pages/default.aspx) * For more i...
github_jupyter
# Managing offline map areas ![](https://developers.arcgis.com/features/offline/offline-maps.jpg) With ArcGIS you can take your web maps and layers offline in field apps to continue work in places with limited or no connectivity. Using [ArcGIS Runtime SDKs](https://developers.arcgis.com/features/offline/), you can bu...
github_jupyter
# Using nbconvert as a library In this notebook, you will be introduced to the programmatic API of nbconvert and how it can be used in various contexts. A great [blog post](http://jakevdp.github.io/blog/2013/04/15/code-golf-in-python-sudoku/) by [@jakevdp](https://github.com/jakevdp) will be used to demonstrate. Th...
github_jupyter
## Ireland Covid-19 datasets * https://data.gov.ie/dataset?q=covid * https://www.hpsc.ie/a-z/respiratory/coronavirus/novelcoronavirus/casesinireland/epidemiologyofcovid-19inireland/ * https://covid19ireland-geohive.hub.arcgis.com/ ``` import pandas as pd import pylab as plt import numpy as np import seaborn as sns im...
github_jupyter
# TensorFlow Tutorial Welcome to this week's programming assignment. Until now, you've always used numpy to build neural networks. Now we will step you through a deep learning framework that will allow you to build neural networks more easily. Machine learning frameworks like TensorFlow, PaddlePaddle, Torch, Caffe, Ke...
github_jupyter
``` import numpy as np import orqviz import matplotlib.pyplot as plt ``` Given this "mysterious loss function named *loss_function*, what can we find out about it? ``` def loss_function(pars): norm_of_pars = np.linalg.norm(pars, ord=2) freq = 2 return -np.sin(freq*norm_of_pars) / (freq*norm_of_pars) + 1 ...
github_jupyter
# Training a ConvNet PyTorch In this notebook, you'll learn how to use the powerful PyTorch framework to specify a conv net architecture and train it on the CIFAR-10 dataset. ``` import torch import torch.nn as nn import torch.optim as optim from torch.autograd import Variable from torch.utils.data import DataLoader ...
github_jupyter
# Label and feature engineering This lab is *optional*. It demonstrates advanced SQL queries for time-series engineering. For real-world problems, this type of feature engineering code is essential. If you are pursuing a time-series project for open project week, feel free to use this code as a template. --- Learni...
github_jupyter
``` # para que funcione para python 2 y 3 from __future__ import division, print_function, unicode_literals import numpy as np import os #salidas repetibles np.random.seed(42) # lindas figuras %matplotlib inline import matplotlib as mpl import matplotlib.pyplot as plt mpl.rc('axes', labelsize=14) mpl.rc('xtick', labels...
github_jupyter
``` # default_exp env_wrappers #hide from nbdev import * ``` # env_wrappers > Here we provide a useful set of environment wrappers. ``` %nbdev_export import gym import numpy as np import torch from typing import Optional, Union %nbdev_export class ToTorchWrapper(gym.Wrapper): """ Environment wrapper for conv...
github_jupyter
### 1. Bias-Variance decomposition Вспомним, что функцию потерь в задачах регрессии или классификации можно разложить на три компоненты: смещение (bias), дисперсию (variance) и шум (noise). Эти компоненты позволяют описать сложность алгоритма, альтернативно сравнению ошибок на тренировочной и тестовой выборках. Хотя т...
github_jupyter
``` %matplotlib notebook import tensorflow as tf import tensorflow.keras as K from tensorflow.keras.losses import categorical_crossentropy import numpy as np import matplotlib.pyplot as plt import cv2 import pandas as pd import sys sys.path sys.path.append("../../models/classification") from models import ResNet, Al...
github_jupyter
``` import tensorflow as tf import numpy as np import os import random import copy import keras from keras.layers import Input, Dense, Conv2D, Dropout, Flatten, Reshape from keras.optimizers import RMSprop, Adam from keras.models import Model from keras.models import Sequential from keras.callbacks import LambdaCallba...
github_jupyter
# Facies classification using machine learning techniques The ideas of <a href="https://home.deib.polimi.it/bestagini/">Paolo Bestagini's</a> "Try 2", <a href="https://github.com/ar4">Alan Richardson's</a> "Try 2", <a href="https://github.com/dalide">Dalide's</a> "Try 6", augmented, by Dimitrios Oikonomou and Eirik L...
github_jupyter
## Setup We'll be using a Python library that helps us to parse markup languages like HTML and XML called BeautifulSoup. We will be using an additional library called `lxml`, which helps BeautifulSoup (aka BS4) to search and build XML. It is possible that you may need to do an extra step to install `lxml` if you have ...
github_jupyter
<a href="https://colab.research.google.com/github/ashishpatel26/100-Days-Of-ML-Code/blob/master/Tensorflow_Basic_Chapter_1.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ## Basic Perceptron ``` import tensorflow as tf print(tf.__version__) W = tf....
github_jupyter
``` import azureml.core from azureml.core import Workspace ws = Workspace.from_config() # Get the default datastore default_ds = ws.get_default_datastore() default_ds.upload_files(files=['./Data/borrower.csv', './Data/loan.csv'], # Upload the diabetes csv files in /data target_path='creditrisk...
github_jupyter
``` import os, sys from glob import glob sys.path.append("../") sys.path.append('/Users/hongwan/GitHub/DarkHistory/') import numpy as np import matplotlib.pyplot as plt import matplotlib.pylab as pylab from scipy.interpolate import interp1d, RegularGridInterpolator from tqdm import * import darkhistory.physics as phy...
github_jupyter
``` from google.colab import drive drive.mount('/content/gdrive') import pandas as pd import glob import datetime as dt import multiprocessing as mp from datetime import datetime import numpy as np import plotly from pandas import Series import sys from scipy import stats from statsmodels.tsa.stattools import adfuller...
github_jupyter
<img src="../../../images/qiskit_header.png" alt="Note: In order for images to show up in this jupyter notebook you need to select File => Trusted Notebook" align="middle"> ## _*Relaxation and Decoherence*_ * **Last Updated:** Feb 25, 2019 * **Requires:** qiskit-terra 0.8, qiskit-ignis 0.1.1, qiskit-aer 0.2 This no...
github_jupyter
## Universal Style Transfer The models above are trained to work for a single style. Using these methods, in order to create a new style transfer model, you have to train the model with a wide variety of content images. Recent work by Yijun Li et al. shows that it is possible to create a model that generalizes to unse...
github_jupyter
This notebook was prepared by [Donne Martin](https://github.com/donnemartin). Source and license info is on [GitHub](https://github.com/donnemartin/interactive-coding-challenges). # Solution Notebook ## Problem: Given two strings, find the longest common substring. * [Constraints](#Constraints) * [Test Cases](#Test-...
github_jupyter
``` !git clone https://github.com/muhwagua/color-bert.git !pip install transformers import random import re import urllib.request import torch import torch.nn as nn from torch.utils.data import DataLoader, Dataset from transformers import ( BertConfig, BertForMaskedLM, BertTokenizer, DataCollatorForLan...
github_jupyter
# Installing Cantera For this notebook you will need [Cantera](http://www.cantera.org/), an open source suite of object-oriented software tools for problems involving chemical kinetics, thermodynamics, and/or transport processes. Fortunately a helpful chap named Bryan Weber has made Anaconda packages, so to install you...
github_jupyter
## Image Classification `CNN` + `Tansfare Learning` > Classifying image from our own dataset with `10` classes. ### Imports ``` import tensorflow as tf from tensorflow import keras import numpy as np import os, random import matplotlib.pyplot as plt import shutil from tensorflow.keras.preprocessing.image import Image...
github_jupyter
# Using `scipy.integrate` ## Authors Zach Pace, Lia Corrales, Stephanie T. Douglas ## Learning Goals * perform numerical integration in the `astropy` and scientific python context * trapezoidal approximation * gaussian quadrature * use `astropy`'s built-in black-body curves * understand how `astropy`'s units intera...
github_jupyter
# Prevalencia Vamos a analizar el influjo de la prevalencia, en el devenir de la enfermedad <div class="alert alert-block alert-info"> En epidemiología, se denomina <strong>prevalencia</strong> a la proporción de individuos de un grupo o una población (en medicina, persona), que presentan una característica o evento ...
github_jupyter
# Entity Extraction from old-style SciSpacy NER Models These models identify the entity span in an input sentence, but don't attempt to separately link to an external taxonomy. The following variations are possible here. Replace the `MODEL_NAME, MODEL_ALIAS` line in the cell below and repeat run to extract named entit...
github_jupyter
Welcome to a series on programming quantum computers. There's no shortage of hype around quantum computing on the internet, but I am going to still outline the propositions made by quantum computing in general, as well as how this pertains to us and programmers who intend to work with quantum computers, which we will b...
github_jupyter
# TensorBoard with Fashion MNIST In this week's exercise you will train a convolutional neural network to classify images of the Fashion MNIST dataset and you will use TensorBoard to explore how it's confusion matrix evolves over time. ## Setup ``` # Load the TensorBoard notebook extension. %load_ext tensorboard imp...
github_jupyter
``` from causaleffect import * '''Define G (example in section 3.3 of paper "Identifying Causal Effects with the R Package causaleffect")''' G1 = createGraph(["X<->Y", "Z->Y", "X->Z", "W->X", "W->Z"]) #plotGraph(G1) '''Define G2 (example Figure 1a of paper "Identification of Joint Interventional Distributions in Recu...
github_jupyter
### Mutable Sequences When dealing with mutable sequences, we have a few more things we can do - essentially adding, removing and replacing elements in the sequence. This **mutates** the sequence. The sequence's memory address has not changed, but the internal **state** of the sequence has. #### Replacing Elements ...
github_jupyter
``` # Based on Huggingface interface # - https://huggingface.co/transformers/notebooks.html # - https://github.com/huggingface/notebooks/blob/master/transformers_doc/quicktour.ipynb # - # Transformers installation, if needed #! pip install transformers datasets ``` # Task: Sentiment analysis ``` # Default model used ...
github_jupyter
# Measuring a Multiport Device with a 2-Port Network Analyzer ## Introduction In microwave measurements, one commonly needs to measure a n-port deveice with a m-port network analyzer ($m<n$ of course). <img src="nports_with_2ports.svg"/> This can be done by terminating each non-measured port with a matched load,...
github_jupyter
<a href="https://colab.research.google.com/github/kyle-gao/ML_ipynb/blob/master/TF_TPU_test.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ##### Copyright 2018 The TensorFlow Authors. ``` #@title Licensed under the Apache License, Version 2.0 (the...
github_jupyter
<table> <tr> <td style="background-color:#ffffff;"> <a href="http://qworld.lu.lv" target="_blank"><img src="..\images\qworld.jpg" width="25%" align="left"> </a></td> <td style="background-color:#ffffff;vertical-align:bottom;text-align:right;"> prepared by <a href="http://abu.lu....
github_jupyter
``` from __future__ import print_function ## Force python3-like printing try: from importlib import reload except: pass %matplotlib inline # %matplotlib notebook from matplotlib import pyplot as plt import os import warnings import numpy as np from astropy.table import Table from scipy.integrate import sim...
github_jupyter
# W-net Model - Train ``` %matplotlib inline import matplotlib.pylab as plt import numpy as np import os import glob import sys from keras.optimizers import Adam # Importing our w-net model MY_UTILS_PATH = "../Modules/" if not MY_UTILS_PATH in sys.path: sys.path.append(MY_UTILS_PATH) import frequency_spatial_net...
github_jupyter
# Bidirectional LSTM Sentiment Classifier In this notebook, we use a *bidirectional* LSTM to classify IMDB movie reviews by their sentiment. #### Load dependencies ``` import tensorflow from tensorflow.keras.datasets import imdb from tensorflow.keras.preprocessing.sequence import pad_sequences from tensorflow.keras....
github_jupyter
# Árboles de decisión y bosques ``` %matplotlib inline import numpy as np import matplotlib.pyplot as plt ``` Ahora vamos a ver una serie de modelos basados en árboles de decisión. Los árboles de decisión son modelos muy intuitivos. Codifican una serie de decisiones del tipo "SI" "ENTONCES", de forma similar a cómo l...
github_jupyter
``` #remove cell visibility from IPython.display import HTML tag = HTML('''<script> code_show=true; function code_toggle() { if (code_show){ $('div.input').hide() } else { $('div.input').show() } code_show = !code_show } $( document ).ready(code_toggle); </script> Toggle cell visibilit...
github_jupyter
``` import tensorflow as tf import random import gym import numpy as np from collections import deque from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Activation, Flatten, Conv2D, MaxPooling2D from tensorflow.keras.optimizers import Adam import gym_super_mario_bros from gym_supe...
github_jupyter
## What is a Variable? A variable is any characteristics, number, or quantity that can be measured or counted. For example: - Age (21, 35, 62, ...) - Gender (male, female) - Income (GBP 20000, GBP 35000, GBP 45000, ...) - House price (GBP 350000, GBP 570000, ...) - Country of birth (China, Russia, Costa Rica, ...) - ...
github_jupyter
# Contributing Contributions are very welcome — please do ask questions and suggest ideas in [Issues](https://github.com/nategadzhi/notoma/issues), and feel free to implement features you want and submit them via Pull Requests. %METADATA% layout: default nav_order: 4 title: Contributing ### Reporting issues Please ...
github_jupyter
# Quantization of Signals *This jupyter notebook is part of a [collection of notebooks](../index.ipynb) on various topics of Digital Signal Processing. Please direct questions and suggestions to [Sascha.Spors@uni-rostock.de](mailto:Sascha.Spors@uni-rostock.de).* ## Requantization of a Speech Signal The following exa...
github_jupyter
# Import libraries ``` import pandas as pd import numpy as np from sklearn.ensemble import RandomForestRegressor from sklearn.metrics import r2_score from sklearn.metrics import mean_absolute_error from sklearn.model_selection import train_test_split from sklearn.model_selection import GridSearchCV import matplotlib.p...
github_jupyter
``` #https://www.powercms.in/blog/how-get-json-data-remote-url-python-script import urllib.request, json #save url inside variable as raw string url = r"https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=MSFT&interval=5min&apikey=demo" #use urllib.request.urlopen() response = urllib.request.urlop...
github_jupyter
# **Boston BLUE bikes Analysis** Team Member: Zhangcheng Guo, Chang-Han Chen, Ziqi Shan, Tsung Yen Wu, Jiahui Xu ### Topic Background and Motivation >A rapidly growing industry, bike-sharing, replaces traditional bike rentals. BLUE bikes' renting procedures are fully automated from picking up, returning, and making p...
github_jupyter
# Dog Breed Identification This example is based on a very popular [Udacity project](https://github.com/udacity/dog-project). The goal is to classify images of dogs according to their breed. In this notebook, you will take the first steps towards developing an algorithm that could be used as part of a mobile or web...
github_jupyter
# Visual English ### Eryk Wdowiak This notebook attempts to illustrate the English text that we're using to develop a neural machine translator. ``` import numpy as np import pandas as pd import matplotlib.pyplot as plt from matplotlib import cm %matplotlib inline import nltk from nltk.tokenize import word_tokeni...
github_jupyter
```sql -- Create a new table CREATE TABLE people ( first_name VARCHAR(30) NOT NULL, has_pet BOOLEAN DEFAULT true, pet_type VARCHAR(10) NOT NULL, pet_name VARCHAR(30), pet_age INT ); ``` ```sql -- Creating tables for PH-EmployeeDB CREATE TABLE departments ( dept_no VARCHAR(4) NOT NULL, dept_name VARCHAR(...
github_jupyter
<a href="https://colab.research.google.com/github/queiyanglim/trading_algorithm/blob/master/brent_wti_copula.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` !git clone https://github.com/queiyanglim/trading_algorithm.git import os os.getcwd() im...
github_jupyter
![RDDs](media/03.rdd_partition.png) # 02 - RDD: RESILENT DISTRIBUTED DATASETS Colección inmutable y distribuida de elementos que pueden manipularse en paralelo Un programa Spark opera sobre RDDs: Spark automáticamente distribuye los datos y paraleliza las operaciones ``` !pip install pyspark # Create apache spark ...
github_jupyter
# SYCL Task Scheduling and Data Dependences ##### Sections - [Buffers and Accessors](#Buffers-and-Accessors) - [Memory Management](#Memory-Management) - [Explicit Data Movement](#Explicit-Data-Movement) - [Implicit data movement](#Implicit-data-movement) - [What is USM?](#What-is-Unified-Shared-Memory?) - [Types of ...
github_jupyter
##### Copyright 2018 The TensorFlow Authors. ``` #@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 ...
github_jupyter
# Synchronisation in Complex Networks ``` import numpy as np import matplotlib.pylab as plt import networkx as nx from NetworkFunctions import * from NetworkClasses import * N = 100; # number of nodes m = 2; G = nx.barabasi_albert_graph(N,m,seed=None); # Barabasi-Albert graph A = nx.to_numpy_matrix(G); # creates adja...
github_jupyter
## ALS Implementation - This notebook |is implementation of ALS algorithm from "collaborative filtering for implicit dataset" ### Initialize parameters - r_lambda: normalization parameter - alpha: confidence level - nf: dimension of latent vector of each user and item - initilzed values(40, 200, 40) are the best...
github_jupyter
``` import kwant import numpy as np import matplotlib.pyplot as pyplot import tinyarray %matplotlib inline import scipy from tqdm.notebook import tqdm ``` $$H = v_f(k_y \sigma_x - k_x\sigma_y) + (m_0 - m_1(k_x^2 + k_y^2))\sigma_z\tau_z + M_z\sigma_z$$ $$H = v_f(k_x\sigma_x - k_y\sigma_y) + (m_0 - m_1(k_x^2 + k_y^2))\...
github_jupyter