text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
# Processing IoT data ## Summary This notebook explains how to process telemetry data coming from IoT devices that arrives trough a gateway enabled edgeHub. ## Description The purpose of this notebook is to explain and guide the reader onto how to process telemetry data generated from IoT devices whitin the DSVM ...
github_jupyter
# DALI expressions and arithmetic operators In this example, we will show simple examples how to use binary arithmetic operators in DALI Pipeline that allow for element-wise operations on tensors inside a pipeline. We will show available operators and examples of using constant and scalar inputs. ## Supported operato...
github_jupyter
## Face and Facial Keypoint detection After you've trained a neural network to detect facial keypoints, you can then apply this network to *any* image that includes faces. The neural network expects a Tensor of a certain size as input and, so, to detect any face, you'll first have to do some pre-processing. 1. Detect...
github_jupyter
# Detailed execution time for cadCAD models *Danilo Lessa Bernardineli* --- This notebook shows how you can use metadata on PSUBs in order to do pre-processing on the simulations. We use two keys for flagging them: the `ignore` which indicates which PSUBs we want to skip, and the `debug`, which informs us what are t...
github_jupyter
### Ch6 Figure1 ``` # Think about your running shoe website. A data analyst should have little trouble finding websites that referred customers to the store. Let's say that most of your customers came from Twitter, Google and Facebook. There were also quite a few customers that came from running shoe websites. A good ...
github_jupyter
# Exercise: FPGA and the DevCloud Now that we've walked through the process of requesting an edge node with a CPU and Intel® Arria 10 FPGA on Intel's DevCloud and loading a model on the Intel® Arria 10 FPGA, you will have the opportunity to do this yourself with the addition of running inference on an image. In this ...
github_jupyter
``` import csv import argparse import json from collections import defaultdict, Counter import re from annotation_tool_1 import MAX_WORDS def process_repeat_dict(d): if d["loop"] == "ntimes": repeat_dict = {"repeat_key": "FOR"} processed_d = process_dict(with_prefix(d, "loop.ntimes.")) if '...
github_jupyter
``` %matplotlib inline ``` # `scikit-learn` - Machine Learning in Python [scikit-learn](http://scikit-learn.org) is a simple and efficient tool for data mining and data analysis. It is built on [NumPy](www.numpy.org), [SciPy](https://www.scipy.org/), and [matplotlib](https://matplotlib.org/). The following examples s...
github_jupyter
<a href="https://qworld.net" target="_blank" align="left"><img src="../qworld/images/header.jpg" align="left"></a> $ \newcommand{\bra}[1]{\langle #1|} $ $ \newcommand{\ket}[1]{|#1\rangle} $ $ \newcommand{\braket}[2]{\langle #1|#2\rangle} $ $ \newcommand{\dot}[2]{ #1 \cdot #2} $ $ \newcommand{\biginner}[2]{\left\langle...
github_jupyter
# 神经网络 ## 全连接层 ### 张量方式实现 ``` import tensorflow as tf from matplotlib import pyplot as plt plt.rcParams['font.size'] = 16 plt.rcParams['font.family'] = ['STKaiti'] plt.rcParams['axes.unicode_minus'] = False # 创建 W,b 张量 x = tf.random.normal([2,784]) w1 = tf.Variable(tf.random.truncated_normal([784, 256], stddev=0.1)) b...
github_jupyter
``` %matplotlib inline ``` # OTDA unsupervised vs semi-supervised setting This example introduces a semi supervised domain adaptation in a 2D setting. It explicits the problem of semi supervised domain adaptation and introduces some optimal transport approaches to solve it. Quantities such as optimal couplings, gre...
github_jupyter
``` import numpy as np import pandas as pd import pickle import math import pandas as pd from pandas import HDFStore import argparse ################################################################################### #location node_ids_filename = 'data/node_locate.txt' with open(node_ids_filename) as f: _node_ids...
github_jupyter
# Tutorial 10: ## Extreme Gradient Boosting Classification Extreme Gradient Boosting, most popularly known as XGBoost is a gradient boosting algorithm that is used for both classification and regression problems. XGBoost is a star among hackathons as a winning algorithm. XGBoost provides a parallel tree boosting that ...
github_jupyter
## Imports ``` import pandas as pd import sys sys.path.insert(0,'../satori') from postprocess import * ``` ## Interaction data processing ``` # For SATORI based interactions df = pd.read_csv('../results/Arabidopsis_GenomeWide_Analysis_euclidean_v8_fixed/Interactions_SATORI/interactions_summary_attnLimit-0.12.txt',...
github_jupyter
# "Namentliche Abstimmungen" in the Bundestag > Parse and inspect "Namentliche Abstimmungen" (roll call votes) in the Bundestag (the federal German parliament) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/eschmidt42/bundestag/HEAD) ## Context The German Parliament is so friendly to p...
github_jupyter
# Getter example The example of simple Getter class usage and even simpler analysis on recieved data. ## Preparations Import instabot from sources ``` import sys sys.path.append('../../') from instabot import User, Getter ``` Login users to be used in instabot. I suggest you to add as many users as you have because...
github_jupyter
# Pushing an image along a Hilbert curve This started out as a discussion with my son about enumerating $\mathbb{N} \times \mathbb{N}$. Cantor found a bijection $\mathbb{N} \rightarrow \mathbb{N} \times \mathbb{N}$. Hilbert found a better bijection $\mathbb{N} \rightarrow \mathbb{N} \times \mathbb{N}$ which can be...
github_jupyter
``` %matplotlib inline import matplotlib.pyplot as plt import numpy as np import pandas as pd from pandas import get_dummies data = pd.read_csv("A0201.csv", sep=",") data.head() indexes = data['sequence'][data['length'] == 9].index #indexes = data.index selected_X = data['sequence'][indexes] selected_y = pd.DataFrame(d...
github_jupyter
``` import numpy as np import pandas as pd import matplotlib import matplotlib.pyplot as plt from sklearn.linear_model import LogisticRegressionCV import sklearn.metrics as metrics from sklearn.preprocessing import PolynomialFeatures from sklearn.discriminant_analysis import LinearDiscriminantAnalysis from sklearn.disc...
github_jupyter
``` # !pip install -q tf-nightly import tensorflow as tf from tensorflow.keras.layers import Conv2D, MaxPooling2D, Flatten, Dense, Dropout from tensorflow.keras.preprocessing.image import ImageDataGenerator import os import numpy as np import matplotlib.pyplot as plt print("Tensorflow Version: {}".format(tf.__version_...
github_jupyter
# Matrix product state simulation method ## Simulation methods The `QasmSimulator` has several simulation methods including `statevector`, `stabilizer`, `extended_stabilizer` and `matrix_product_state`. Each of these determines the internal representation of the quantum circuit and the algorithms used to process the q...
github_jupyter
# Initilization ``` !mkdir -p models !wget "https://drive.google.com/uc?id=1E95HNEYQI1R-UTuYwJOycrYDJxFxiICC&export=download" -O songs.p !pip install tensorflow-gpu==1.14 ``` # Dataset Preparation ``` %pylab inline import pickle import pandas as pd import keras from music21 import converter, instrument, note, chord,...
github_jupyter
# 8. Dashboard In this notebook we created a dashboard based on a little EDA with the tmdb dataset. As output we decided, the dashboard should contain a figure with the most expensive movies, the most popular ones, the proportion of different movie genres, the production countries and the releases over the year. As co...
github_jupyter
# Learning Objectives: 1. Reading files 2. Exploring the read dataframe 3. Checking the dataframe info 4. Merging the two dataframes into one 5. Defining questions for the analysis 6. Cleaning Steps ``` import numpy as np import pandas as pd ``` ## Reading the files ``` movies_df = pd.read_csv("../data/movies.csv")...
github_jupyter
``` import pickle import os import numpy as np base_dirs = ['/localdata/juan/inferno/', '/localdata/juan/erehwon/', '/localdata/juan/numenor/'] experiments = ['dcp_mcpilco_dropoutd_mlpp_4', 'dcp_mcpilco_lndropoutd_mlpp_6', 'dcp_mcpilco_dropoutd_dropoutp_7', ...
github_jupyter
``` # This cell is added by sphinx-gallery !pip install mrsimulator --quiet %matplotlib inline import mrsimulator print(f'You are using mrsimulator v{mrsimulator.__version__}') ``` # ¹¹⁹Sn MAS NMR of SnO The following is a spinning sideband manifold fitting example for the 119Sn MAS NMR of SnO. The dataset was ac...
github_jupyter
--- ``` __authors__ = ["Tricia D Shepherd" , "Ryan C. Fortenberry", "Matthewy Kennedy", "C. David Sherril"] __credits__ = ["Victor H. Chavez", "Lori Burns"] __email__ = ["profshep@icloud.com", "r410@olemiss.edu"] __copyright__ = "(c) 2008-2019, The Psi4Education Developers" __license__ = "BSD-3-Clause" __date__ ...
github_jupyter
Utilities to visualize agent's trade execution and portfolio performance Chapter 4, TensorFlow 2 Reinforcement Learning Cookbook | Praveen Palanisamy ``` import matplotlib import matplotlib.pyplot as plt import mplfinance as mpf import numpy as np import pandas as pd from matplotlib import style from mplfinance.origin...
github_jupyter
### Preparing Working Env ``` import matplotlib.pyplot as plt import numpy as np from importlib.util import find_spec if find_spec("core") is None: import sys sys.path.append('..') import tensorflow as tf import tensorflow_datasets as tfds import random from core.datasets import RetinaDataset from core.datas...
github_jupyter
![JohnSnowLabs](https://nlp.johnsnowlabs.com/assets/images/logo.png) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/spark-nlp-workshop/blob/master/tutorials/streamlit_notebooks/CLASSIFICATION_EN_TREC.ipynb) # **Classify text accordi...
github_jupyter
# Downloading and saving CSV data files from the web ``` import urllib.request url = 'http://archive.ics.uci.edu/ml/machine-learning-databases/wine/wine.data' csv_cont = urllib.request.urlopen(url) csv_cont = csv_cont.read() # .decode('utf-8') # saving the data to local drive #with open('./datasets/wine_data.csv', '...
github_jupyter
# FastAI Experiments Using Google Colab CPU <a href="https://colab.research.google.com/github/rambasnet/DeepLearningMaliciousURLs/blob/master/FastAI-Experiments.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ## Import Libraries ``` from fastai.ta...
github_jupyter
``` %load_ext autoreload %autoreload 2 import os, sys currentdir = os.path.dirname(os.path.realpath("__file__")) parentdir = os.path.dirname(currentdir) sys.path.append(parentdir) ``` # 2. Index assets In order to build a mosaic, we want to replace each image part with a matching source picture (a patch). We will ru...
github_jupyter
# BERT + Keras 对新闻标题分类 日期:2020年4月3日 此方法与 PyTorch 的前半部分基本一致。 ``` import os import re import time import numpy as np import pandas as pd import transformers from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelEncoder import tensorflow as tf import tensorflow.keras.backend as K ...
github_jupyter
# Final Project Report Group 10 ## <u> Insurance Cross Selling <u> Ashwin Yenigalla. Natwar Koneru, Pratheep Raju, Rahul Narang ### <u> Data Dictionary <u> The dataset is from Kaggle.com: https://www.kaggle.com/anmolkumar/health-insurance-cross-sell-prediction Unique ID Rows: 381109 values Data Features are a...
github_jupyter
``` import os import json from docx import Document from io import StringIO, BytesIO import re import time import pandas as pd import json import spacy from nltk.corpus import stopwords from gensim.models import LdaModel from gensim.models.wrappers import LdaMallet import gensim.corpora as corpora from gensim.corpora...
github_jupyter
# The central limit theorem ## Understanding via visualization #### Giovanni Pizzi (EPFL), Sep 2018 [Go back to the list of all visualizations](https://github.com/giovannipizzi/educational-scientific-visualizations/) # Aim of this app The aim of this app is to: - visually prove the central limit theorem - give a feeli...
github_jupyter
<a href="https://colab.research.google.com/github/gmihaila/machine_learning_things/blob/master/learning_pytorch/pytorch_nn.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ### SImple NN 1 hiddent layer NN #### Initialize NN ``` import torch n_inp...
github_jupyter
# Gibbs Sampling [Casella 1992](http://biostat.jhsph.edu/~mmccall/articles/casella_1992.pdf) Suppose we are given a joint density $f(x, y_1, \ldots, y_p)$ and are interested in obtaining the characteristics of the marginal density $$ f(x) = \int\ldots\int f(x, y_1,\ldots, y_p)dy_1\ldots dy_p $$ such as the mean or va...
github_jupyter
##### Copyright 2019 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
# A/B test 2 - Loved journeys, control vs content similarity sorted list This related links A/B test (ab2) was conducted from 26 Feb -5th March 2019. The data used in this report are 27th Feb 2019 - 5th March because on 26th the split was not 50:50. The test compared the existing related links (where available) to l...
github_jupyter
# The Acrobot (v-1) Problem Acrobot is a 2-link pendulum with only the second joint actuated. Intitially, both links point downwards. The goal is to swing the end-effector at a height at least the length of one link above the base. Both links can swing freely and can pass by each other, i.e., they don't collide when ...
github_jupyter
``` import numpy as np from numpy import ndarray from typing import List def assert_same_shape(array: ndarray, array_grad: ndarray): assert array.shape == array_grad.shape, \ ''' 두 ndarray의 모양이 같아야 하는데, 첫 번째 ndarray의 모양은 {0}이고, 두 번째 ndarray의 모양은 {1}이다. ...
github_jupyter
``` from __future__ import print_function, division from keras.datasets import fashion_mnist import pandas as pd import numpy as np from scipy.interpolate import interp1d import os from keras.layers import Input, Dense, Reshape, Flatten, Dropout, multiply from keras.layers import BatchNormalization, Activation, Embeddi...
github_jupyter
``` # from google.colab import drive # drive.mount('/content/drive') # path = "/content/drive/MyDrive/Research/cods_comad_plots/sdc_task/mnist/" m = 100 desired_num = 100 import torch.nn as nn import torch.nn.functional as F import pandas as pd import numpy as np import matplotlib.pyplot as plt import torch import to...
github_jupyter
# py12box model usage This notebook shows how to set up and run the AGAGE 12-box model. ## Model schematic The model uses advection and diffusion parameters to mix gases between boxes. Box indices start at the northern-most box and are as shown in the following schematic: <img src="box_model_schematic.png" alt="Box...
github_jupyter
# Windows Metadata Structure and Value Issues This notebook shows a few examples of the varience that occurs and encumbers parsing windows metadata extracted and serialised via `Get-EventMetadata.ps1` into the file `.\Extracted\EventMetadata.json.zip`. Below is the number of records in my sample metadata extract. ``...
github_jupyter
``` %load_ext autoreload %autoreload 2 ``` This notebook is a tentative overview of how we can use my custom library `neurgoo` to train ANNs. Everything is written from scratch, directly utilizing `numpy`'s arrays and vectorizations. `neurgoo`'s philosophy is to be as modular as possible, inspired from PyTorch's API...
github_jupyter
# Sersic Profiles <h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Setup" data-toc-modified-id="Setup-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Setup</a></span></li><li><span><a href="#Sersic-parameter-fits" data-toc-modified-id="Sersic-parameter...
github_jupyter
# ORF recognition by LSTM LSTM and GRU are two variants of recurrent neural network (RNN). LSTM was incapable of recognizing short ORFs. How about GRU? ``` import time t = time.time() time.strftime('%Y-%m-%d %H:%M:%S %Z', time.localtime(t)) PC_SEQUENCES=20000 # how many protein-coding sequences NC_SEQUENCES=20000 ...
github_jupyter
# Furniture Rearrangement - How to setup a new interaction task in Habitat-Lab This tutorial demonstrates how to setup a new task in Habitat that utilizes interaction capabilities in Habitat Simulator. ![teaser](https://drive.google.com/uc?id=1pupGvb4dGefd0T_23GpeDkkcIocDHSL_) ## Task Definition: The working example...
github_jupyter
<a href="https://colab.research.google.com/github/gtbook/robotics/blob/main/S36_vacuum_RL.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` %pip install -q -U gtbook import numpy as np import gtsam import pandas as pd import gtbook import gtbook....
github_jupyter
# Figure 3: iModulon Examples ## Setup ``` from os import path import seaborn as sns import matplotlib.pyplot as plt from pymodulon.io import load_json_model from pymodulon.plotting import * ``` ### Set plotting style ``` sns.set_style('ticks') plt.style.use('custom.mplstyle') ``` ### Load data ``` figure_dir = ...
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
# **Assignment - 2: Basic Data Understanding** --- This assignment will get you familiarized with Python libraries and functions required for data visualization. --- ## Part 1 - Loading data --- ###Import the following libraries: * ```numpy``` with an alias name ```np```, * ```pandas``` with an alias name ``...
github_jupyter
![Callysto.ca Banner](https://github.com/callysto/curriculum-notebooks/blob/master/callysto-notebook-banner-top.jpg?raw=true) <a href="https://hub.callysto.ca/jupyter/hub/user-redirect/git-pull?repo=https%3A%2F%2Fgithub.com%2Fcallysto%2Fcurriculum-notebooks&branch=master&subPath=TechnologyStudies/IntroductionToDataStr...
github_jupyter
# Minimum inter-class distances of all points of different dataset in different norms in table form ``` import os os.chdir("../") import sys import json import math import numpy as np import pickle from PIL import Image from sklearn import metrics from sklearn.metrics import pairwise_distances as dist import matplotli...
github_jupyter
Conditional Generative Adversarial Network ---------------------------------------- *Note: This example implements a GAN from scratch. The same model could be implemented much more easily with the `dc.models.GAN` class. See the MNIST GAN notebook for an example of using that class. It can still be useful to know ho...
github_jupyter
<a href="https://colab.research.google.com/github/mashyko/Caffe2_Detectron2/blob/master/Caffe2_Quickload.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> #Tutorials Installation: https://caffe2.ai/docs/tutorials.html First download the tutorials sou...
github_jupyter
# BERTを用いたテキスト分類 このノートブックでは、[BERT](https://arxiv.org/abs/1810.04805)を用いて分類器を構築します。BERTは事前学習済みのNLPのモデルであり、2018年にGoogleによって公開されました。データセットとしては、IMDBレビューデータセットを使います。 なお、学習には時間がかかるので、GPUを使うことを推奨します。 ## 準備 ### パッケージのインストール ``` !pip install tensorflow-text==2.6.0 tf-models-official==2.6.0 ``` ### インポート ``` import os imp...
github_jupyter
``` from PyQt4 import QtGui import os, sys import pandas as pd import pandas_datareader.data as web import numpy as np import matplotlib.pyplot as plt from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar...
github_jupyter
# Demystifying Approximate Bayesian Computation #### Brett Morris ### In this tutorial We will write our own rejection sampling algorithm to approximate the posterior distributions for some fitting parameters. ``` %matplotlib inline import matplotlib.pyplot as plt import numpy as np from scipy.stats import anderso...
github_jupyter
## Contoso ISD solution package This notebook is for creating a consolidated view over the data from each of the source systems. ``` storage_account = 'steduanalytics__update_this' use_test_env = True if use_test_env: stage1 = 'abfss://test-env@' + storage_account + '.dfs.core.windows.net/stage1' stage2 = 'abf...
github_jupyter
``` import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from torch.autograd import Variable from torch.utils.data import TensorDataset, Dataset, DataLoader, random_split from torch.nn.utils.rnn import pack_padded_sequence, pack_sequence, pad_packed_sequence, pad_sequence impo...
github_jupyter
## Analysis of UK's Tradings for 2014 Trading Year Task: A country's economy depends, sometimes heavily, on its exports and imports. The United Nations Comtrade database provides data on global trade. It will be used to analyse the UK's imports and exports of milk and cream in 2015: - How much does the UK export and...
github_jupyter
# Spark Lab This lab will demonstrate how to perform web server log analysis with Spark. Log data is a very large, common data source and contains a rich set of information. It comes from many sources, such as web, file, and compute servers, application logs, user-generated content, and can be used for monitoring ser...
github_jupyter
## Dependencies ``` import json, warnings, shutil from tweet_utility_scripts import * from tweet_utility_preprocess_roberta_scripts import * from transformers import TFRobertaModel, RobertaConfig from tokenizers import ByteLevelBPETokenizer from tensorflow.keras.models import Model from tensorflow.keras import optimiz...
github_jupyter
# Surface ``` import matplotlib.pylab as plt from mpl_toolkits.mplot3d import Axes3D import numpy as np fig = plt.figure() ax = fig.add_subplot(111, projection='3d') x = y = np.linspace(-3,3,100) X, Y = np.meshgrid(x, y) Z = X**4+Y**4-16*X*Y ax.plot_surface(X, Y, Z) ax.set_zlim3d(0,120) ax.set_xlabel('X Axis') ax.set...
github_jupyter
# Arrays, lists and tuples In python, there are variables which can contain multiple entry of different kinds. In programming, we call them arrays; arrays of values. We already know one kind of arrays, strings. Strings are arrays of characters. See also * [Arrays](https://physics.nyu.edu/pine/pymanual/html/chap3/chap3...
github_jupyter
# Regression with Amazon SageMaker XGBoost (Parquet input) This notebook exhibits the use of a Parquet dataset for use with the SageMaker XGBoost algorithm. The example here is almost the same as [Regression with Amazon SageMaker XGBoost algorithm](xgboost_abalone.ipynb). This notebook tackles the exact same problem ...
github_jupyter
# BLU15 - Model CSI ## Part 1 of 2 - When to train your model In this notebook we will be covering the following: - 1. The need for retraining - 1.1 Data drift - 1.2 Robustness - 1.3 When ground truth is not available at the time of model training - 1.4 Concept drift - 2. How to measure the decline in model p...
github_jupyter
# Paper Figure Creation - Created on a cloudly London Saturday morning, April 3rd 2021 - Revised versions of the figures ``` import climlab import numpy as np import xarray as xr import matplotlib.pyplot as plt import matplotlib.ticker as mticker import xarray as xr import pandas as pd import cartopy.crs as ccrs from...
github_jupyter
# 2A.data - Matplotlib Tutoriel sur [matplotlib](https://matplotlib.org/). ``` from jyquickhelper import add_notebook_menu add_notebook_menu() ``` *Aparté* Les librairies de visualisation en python se sont beaucoup développées ([10 plotting librairies](http://www.xavierdupre.fr/app/jupytalk/helpsphinx/2016/pydata20...
github_jupyter
<a href="https://colab.research.google.com/github/ShreyasJothish/ai-platform/blob/master/tasks/methodology/word-embeddings/Word_Embeddings.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Word Embeddings using Word2Vec. ### Procedure 1) I shall b...
github_jupyter
<p><font size="6"><b>05 - Pandas: "Group by" operations</b></font></p> > *© 2016-2018, Joris Van den Bossche and Stijn Van Hoey (<mailto:jorisvandenbossche@gmail.com>, <mailto:stijnvanhoey@gmail.com>). Licensed under [CC BY 4.0 Creative Commons](http://creativecommons.org/licenses/by/4.0/)* --- ``` %matplotlib inli...
github_jupyter
``` import tensorflow as tf hellow_constant = tf.constant('Hello Tensor Constant') with tf.Session() as sess: output = sess.run(hellow_constant) print(output) x = tf.placeholder(tf.string) y = tf.placeholder(tf.float32) z = tf.placeholder(tf.int32) with tf.Session() as sess: output = sess.run(x, feed_dict...
github_jupyter
``` import os from glob import glob import pandas as pd import numpy as np from scipy import stats from matplotlib import pyplot as plt from matplotlib.colors import Normalize from matplotlib.backends.backend_pdf import PdfPages from matplotlib import gridspec import json import torch import gpytorch import h5py import...
github_jupyter
# Scripting `bettermoments` In this Notebook, we will step through how to integrate the moment map making process (in this case, a zeroth moment map, or integrated intensity map), into your workflow. This should elucidate the steps that are taken automatically when using the [command line interface](https://bettermom...
github_jupyter
## Classes for callback implementors ``` from fastai.gen_doc.nbdoc import * from fastai.callback import * from fastai.basics import * ``` fastai provides a powerful *callback* system, which is documented on the [`callbacks`](/callbacks.html#callbacks) page; look on that page if you're just looking for how to use exi...
github_jupyter
What is PyTorch? ================ It’s a Python-based scientific computing package targeted at two sets of audiences: - A replacement for NumPy to use the power of GPUs - a deep learning research platform that provides maximum flexibility and speed Getting Started --------------- Tensors ^^^^^^^ Tensors are ...
github_jupyter
# <img style="float: left; padding-right: 10px; width: 45px" src="https://raw.githubusercontent.com/Harvard-IACS/2018-CS109A/master/content/styles/iacs.png"> CS109B Introduction to Data Science ## Lab 8: Recurrent Neural Networks and Introduction to Natural Language Processing **Harvard University**<br/> **Spring 202...
github_jupyter
``` !wget www.di.ens.fr/~lelarge/MNIST.tar.gz !tar -zxvf MNIST.tar.gz import torch import torchvision from torchvision.datasets import MNIST from torch.utils.data import random_split, DataLoader import torch.nn.functional as F from collections import namedtuple import matplotlib.pyplot as plt Dataset = MNIST(root="./"...
github_jupyter
# Aim of this notebook * To construct the singular curve of universal type to finalize the solution of the optimal control problem # Preamble ``` from sympy import * init_printing(use_latex='mathjax') # Plotting %matplotlib inline ## Make inline plots raster graphics from IPython.display import set_matplotlib_forma...
github_jupyter
# Construction In this section, we construct two classes to implement a basic feed-forward neural network. For simplicity, both are limited to one hidden layer, though the number of neurons in the input, hidden, and output layers is flexible. The two differ in how they combine results across observations. The first lo...
github_jupyter
# Shor's Algorithm for Factorization of Integers Given a large number $N$, say with at least 100 digits, how can we find a factor of $N$? There are several famous classical algorithms, and [Wikipedia](https://en.wikipedia.org/wiki/Integer_factorization) contains an exhaustive list of these algorithms. The best known a...
github_jupyter
<a href="https://colab.research.google.com/github/cyberboysumanjay/RcloneLab/blob/master/RcloneLab.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> #### 📚 For more information please visit our [GitHub](https://github.com/cyberboysumanjay/RcloneLab/)...
github_jupyter
# fastai and the New DataBlock API > A quick glance at the new top-level api - toc: true - badges: true - comments: true - image: images/chart-preview.png - category: DataBlock --- This blog is also a Jupyter notebook available to run from the top down. There will be code snippets that you can then run in any envir...
github_jupyter
##### Copyright 2019 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
<a href="https://colab.research.google.com/github/cohmathonc/biosci670/blob/master/IntroductionComputationalMethods/exercises/07_ODEs.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` import numpy as np import matplotlib.pylab as plt ``` ## Solvi...
github_jupyter
``` #import packages import tensorflow as tf from tensorflow.keras import layers import tensorflow_datasets as tfds import matplotlib.pylab as plt import os import zipfile from tensorflow.keras.preprocessing.image import ImageDataGenerator local_zip = '../Dataset/horse-or-human.zip' zip_ref = zipfile.ZipFile(local_zip,...
github_jupyter
# Python для анализа данных ## Что такое SQL. Как писать запросы. Работа с Clickhouse. Автор: *Ян Пиле, НИУ ВШЭ* Язык SQL очень прочно влился в жизнь аналитиков и требования к кандидатам благодаря простоте, удобству и распространенности. Часто SQL используется для формирования выгрузок, витрин (с последующим постро...
github_jupyter
In this project, I implemented three models, which are subtractor, adder-subtractor, adder-subtractor-multiplier, based on `Addition.ipynb` provided in homework3 sameple code. And I wrote three jupyter notebooks of these models, which named [Subtractor.ipynb](https://nbviewer.jupyter.org/github/rapirent/DSAI-HW3/blob/...
github_jupyter
# Image segmentation with a U-Net-like architecture **Author:** [fchollet](https://twitter.com/fchollet)<br> **Date created:** 2019/03/20<br> **Last modified:** 2020/04/20<br> **Description:** Image segmentation model trained from scratch on the Oxford Pets dataset. ## Download the data ``` !curl -O http://www.robot...
github_jupyter
``` %matplotlib inline import numpy as np import matplotlib.pyplot as plt import pandas as pd from pandas import Series, DataFrame import numpy.random as rnd import scipy.stats as st import os plt.style.use(os.path.join(os.getcwd(), 'mystyle.mplstyle') ) nvalues = 10 norm_variates = rnd.randn(nvalues) norm_variates for...
github_jupyter
# Learning Curves and Bias-Variance Tradeoff In practice, much of the task of machine learning involves selecting algorithms, parameters, and sets of data to optimize the results of the method. All of these things can affect the quality of the results, but it’s not always clear which is best. For example, if your resu...
github_jupyter
<a href="https://colab.research.google.com/github/yukinaga/minnano_kaggle/blob/main/section_2/01_pandas_basic.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Pandasの基礎 PandasはPythonでデータ分析を行うためのライブラリで、データの読み込みや編集、統計量の表示などを簡単に行うことができます。 主要なコードはCyt...
github_jupyter
# First and Second order random walks First and second order random walks are a node-sampling mechanism that can be employed in a large number of algorithms. In this notebook we will shortly show how to use Ensmallen to sample a large number of random walks from big graphs. To install the GraPE library run: ``` pip i...
github_jupyter
![](https://github.com/hse-econ-data-science/dap_2021_spring/blob/main/sem02_forif/flowchart.png?raw=true) ``` x = 1 if x == 1: print('That is true') x = 1 if x != 1: print('That is true') else: print('x = 1') if x == 1: print('That is true!') a = int(input()) b = int(input()) if a < b: print(a) el...
github_jupyter
``` import sys sys.path.insert(0, '..') from branca.element import * ``` ## Element This is the base brick of `branca`. You can create an `Element` in providing a template string: ``` e = Element("This is fancy text") ``` Each element has an attribute `_name` and a unique `_id`. You also have a method `get_name` t...
github_jupyter
<a href="https://practicalai.me"><img src="https://raw.githubusercontent.com/practicalAI/images/master/images/rounded_logo.png" width="100" align="left" hspace="20px" vspace="20px"></a> <img src="https://raw.githubusercontent.com/practicalAI/images/master/basic_ml/06_Multilayer_Perceptron/nn.png" width="200" vspace="1...
github_jupyter