text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
``` #IMPORT SEMUA LIBARARY #IMPORT LIBRARY PANDAS import pandas as pd #IMPORT LIBRARY UNTUK POSTGRE from sqlalchemy import create_engine import psycopg2 #IMPORT LIBRARY CHART from matplotlib import pyplot as plt from matplotlib import style #IMPORT LIBRARY BASE PATH import os import io #IMPORT LIBARARY PDF from fpdf im...
github_jupyter
``` try: file = open('Curso em Vídeo/PYTHON_W3/ex115/lib/dados/cadastro.txt', 'rt') file.close() except: print('deu ruim') else: print('foi...') a = ['leo', '50\n'] print(a) print(a[1][:-1]) print(a[0]) def éInt(str): try: str = int(str) except (ValueError, TypeError): print('Tip...
github_jupyter
``` from lcls_live.datamaps.tabular import TabularDataMap from lcls_live.datamaps.klystron import KlystronDataMap, klystron_pvinfo, existing_LCLS_klystrons_sector_station, subbooster_pvinfo, SUBBOOSTER_SECTORS from pytao import Tao import json import os from lcls_live import data_dir import pandas as pd ``` ## Build d...
github_jupyter
# EDA Flights Dataset ``` # Packages #install.packages("psych") library(psych) library(ggplot2) #install.packages('ggpubr') library(ggpubr) library(dplyr) #install.packages('reshape') library(reshape) library(ggrepel) ``` # Airlines Analysis ## Rate and Punctuality X Number of Flights (FIG 8) ``` dsAtd = read.csv('...
github_jupyter
# Title _Brief abstract/introduction/motivation. State what the chapter is about in 1-2 paragraphs._ _Then, have an introduction video:_ ``` from bookutils import YouTubeVideo YouTubeVideo("w4u5gCgPlmg") ``` **Prerequisites** * _Refer to earlier chapters as notebooks here, as here:_ [Earlier Chapter](Fuzzer.ipynb)...
github_jupyter
## Importing the requirements ``` import pandas as pd import numpy as np from collections import deque import random from sklearn import preprocessing from google.colab import files import time import tensorflow as tf from tensorflow.keras.models import Sequential from tensorflow.compat.v1.k...
github_jupyter
# Automated Machine Learning #### Forecasting away from training data ## Contents 1. [Introduction](#Introduction) 2. [Setup](#Setup) 3. [Data](#Data) 4. [Prepare remote compute and data.](#prepare_remote) 4. [Create the configuration and train a forecaster](#train) 5. [Forecasting from the trained model](#forecasti...
github_jupyter
### Instructions The lecture applies an svc model (specifically a regression model) to the [epicurious dataset on Kaggle](https://www.kaggle.com/hugodarwood/epirecipes). The information in the dataset includes a list keywords and ingredients as well as the title of the recipe and a rating. The goal was to predict the...
github_jupyter
``` import pandas as pd from pathlib import Path sub_folder = "9" results_path = Path("results_community") / sub_folder # Directory where we will store all the results results_path.mkdir(exist_ok=True, parents=True) # Write mp3 lengths typescript object (requires mutagen) from mutagen.mp3 import MP3 audio_base_path =...
github_jupyter
# Decision tree (classification) algorithm --- - **Traininig**: 1. Find most *informative* combination of `node of the tree`, `feature`, and `split value` 2. Do split if `max_depth` is not reached 3. Iterate over 1-2. - **Inference** (prediction): - Follow the rules ^_^. ## Decision t...
github_jupyter
``` import pandas as pd import random import requests import time # formatting pd.set_option('display.float_format', lambda x: '%.3f' % x) pd.set_option('display.max_columns', 500) pd.set_option('display.max_rows', 5000) # postgres # from sqlalchemy import create_engine # import psycopg2 # To be Added, Database Lo...
github_jupyter
# "AGILE SAFe Training - Notes" > "Notes about SAFe (Scaled Agile Framework for Enterprise)" - toc: true - branch: master - badges: false - comments: true - categories: [Others] - hide: false - search_exclude: false - image: images/post-thumbnails/safe_agile.png - metadata_key1: Agile - metadata_key2: ## Introducing...
github_jupyter
# How to use custom data and implement custom models and metrics ## Building a simple, first model For demonstration purposes we will choose a simple fully connected model. It takes a timeseries of size `input_size` as input and outputs a new timeseries of size `output_size`. You can think of this `input_size` encodi...
github_jupyter
<a href="https://colab.research.google.com/github/borisbrodski/py-interplanetary-simulator/blob/master/StarKicker%20-%20cutting%20down%20on%20travel%20time%20to%20Mars/Calculate_mission_profile.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # StarK...
github_jupyter
``` # Reload when code changed: %load_ext autoreload %autoreload 2 %pwd %matplotlib inline import os import sys path = "../" sys.path.append(path) #os.path.abspath("../") print(os.path.abspath(path)) import pandas as pd import numpy as np import json import pickle import core import importlib importlib.reload(core) im...
github_jupyter
# Data Explorer PixieApp This notebook contains a [PixieApp](https://ibm-watson-data-lab.github.io/pixiedust/pixieapps.html) that provides quick visual and numeric summaries of the fields in a Pandas DataFrame. ## Requirements A 2-dimensional Pandas DataFrame ## Help Post an issue on https://github.com/ibm-watson...
github_jupyter
# Adversarial X **Разработчики: Алексей Умнов, Александр Шевченко, Ирина Сапарина** # Adversarial examples В этом разделе мы будем создавать adversarial примеры для типичной архитектуры сетей. Для начала нужно сделать простую сверточную сеть для классификации (2-3 слоя) и обучить ее до нормального качества (>97%). Д...
github_jupyter
<a href="https://colab.research.google.com/github/Freitashbruno/Portfolio/blob/master/SemanaDS.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ## **Semana de Data Science** - Minerando Dados ### Conhecendo a base de dados Monta o drive ``` from ...
github_jupyter
# Ordinal Regression ``` import numpy as np import pandas as pd import scipy.stats as stats from statsmodels.miscmodels.ordinal_model import OrderedModel ``` Loading a stata data file from the UCLA website.This notebook is inspired by https://stats.idre.ucla.edu/r/dae/ordinal-logistic-regression/ which is a R notebo...
github_jupyter
``` import os from tqdm.notebook import tqdm from pathlib import Path import pandas as pd from nltk.lm import Vocabulary import sys sys.path.append("../../lib") from metrics import levenshtein import pickle folder = "../../data/ICDAR2019_POCR_competition_dataset/ICDAR2019_POCR_competition_training_18M_without_Finnish/F...
github_jupyter
# Matching Networks Matching networks are yet another simple and efficient one-shot learning algorithm published by Google's DeepMind. It can even produce labels for the unobserved class in the dataset. Let us say we have a support set $S$ containing $K$ examples as ${(x_1,y_1),(x_2,y_2)...(x_k,y_k)}$. When given a qu...
github_jupyter
# Numba example ``` from numba import njit, jit import numba.cuda as cuda import random points = 100000 def pi(npoints): n_in_circle = 0 for i in range(npoints): x = random.random() y = random.random() if (x**2+y**2 < 1): n_in_circle += 1 return 4*n_in_circle / npoint...
github_jupyter
``` """Tutorial on how to create a convolutional autoencoder w/ Tensorflow. Parag K. Mital, Jan 2016 """ import tensorflow as tf import numpy as np import math from libs.activations import lrelu from libs.utils import corrupt # %% def autoencoder(input_shape=[None, 784], n_filters=[1, 10, 10, 10], ...
github_jupyter
# Donkey library tools Let's take a look the tools provided by the [Donkey](https://github.com/wroscoe/donkey) library. ## The Donkey library The [Donkey library](https://github.com/wroscoe/donkey) has several components. It is first and foremost a python library installed where your other python libraries are (e.g...
github_jupyter
``` import numpy as np import pandas as pd titanic = pd.read_csv("titanictrain.csv") titanic_test = pd.read_csv("titanictest.csv") titanic.drop("PassengerId", axis = 1, inplace = True) titanic.drop("Name", axis=1, inplace = True) titanic.drop("Ticket", axis=1, inplace = True) titanic.drop("Cabin", axis=1, inplace = Tru...
github_jupyter
___ <img style="float: right; margin: 0px 0px 15px 15px;" src="https://upload.wikimedia.org/wikipedia/commons/thumb/4/4a/Python3-powered_hello-world.svg/1000px-Python3-powered_hello-world.svg.png" width="300px" height="100px" /> # <font color= #8A0829> Simulación matemática.</font> #### <font color= #2E9AFE> `Lunes(...
github_jupyter
# Node classification with GraphSAGE <table><tr><td>Run the latest release of this notebook:</td><td><a href="https://mybinder.org/v2/gh/stellargraph/stellargraph/master?urlpath=lab/tree/demos/node-classification/graphsage-node-classification.ipynb" alt="Open In Binder" target="_parent"><img src="https://mybinder.org/...
github_jupyter
# Tirone Levels https://www.metastock.com/customer/resources/taaz/?p=110 ``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import warnings warnings.filterwarnings("ignore") # fix_yahoo_finance is used to fetch data import fix_yahoo_finance as yf yf.pdr_override() # input symbol = 'AAPL' st...
github_jupyter
## Geo classification Divide tweets based on their geographic location and perform stance analysis per group. ``` import ast import fasttext import os import pandas as pd import re import sys from IPython.display import clear_output from nltk.tokenize import TweetTokenizer BELGIUM = "Belgium" DATE = "date" DISTANCE ...
github_jupyter
###### Content under Creative Commons Attribution license CC-BY 4.0, code under MIT license (c)2014 L.A. Barba, C. Cooper, G.F. Forsyth, A. Krishnan. # Phugoid Motion Welcome to [**"Practical Numerical Methods with Python!"**](http://openedx.seas.gwu.edu/courses/GW/MAE6286/2014_fall/about) This course is a collaborat...
github_jupyter
# SqueezeNet Architecture Design *by Marvin Bertin* <img src="../../images/keras-tensorflow-logo.jpg" width="400"> # SqueezeNet **What is SqueezeNet?** - a deep convolutional neural network (CNN) - compressed architecture design - model contains relatively small amount of parameters - achieve AlexNet-level accuracy o...
github_jupyter
``` sc user_data = sc.textFile('ml-100k/u.user') user_data.first() user_fields = user_data.map(lambda line: line.split('|')) num_users = user_fields.map(lambda fields:fields[0]).count() # 统计用户数 num_genders = user_fields.map(lambda fields: fields[2]).distinct().count() # gender count num_occupations = user_fields.map(...
github_jupyter
``` #hide from mrl.core import * ``` # Molecular Reinforcement Learning > Unlocking reinforcement learning for drug design - hide_colab_badge:true MRL is an open source python library designed to unlock the potential of drug design with reinforcement learning. MRL bridges the gap between generative models and prac...
github_jupyter
# Generating the Plots of the Denoising Results In this notebook we reproduce the denoising results shown in figure 4 of the paper. We start by importing the required libraires, setting the plot parameters and loading the result data. ``` #import libraries import numpy as np import matplotlib.pyplot as plt #set plot...
github_jupyter
# Import and format MP data datasets for SCHOLAR ``` import os, sys, scipy, json from scipy import sparse import codecs import numpy as np import pandas as pd import file_handling as fh ``` # MP speeches ## load booking data and save in SCHOLAR format ``` if sys.platform == "darwin": pass else: raw_data_pat...
github_jupyter
<a href="https://colab.research.google.com/github/thingumajig/colab-experiments/blob/master/qa.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Init ## Install packages ``` !pip install spacy !pip3 uninstall --quiet --yes tensorflow !pip3 instal...
github_jupyter
<a href="https://cognitiveclass.ai"><img src = "https://ibm.box.com/shared/static/9gegpsmnsoo25ikkbl4qzlvlyjbgxs5x.png" width = 400> </a> <h1 align=center><font size = 5>Introduction to Matplotlib and Line Plots</font></h1> ## Introduction The aim of these labs is to introduce you to data visualization with Python a...
github_jupyter
# Hierarchical Clustering **Hierarchical clustering** refers to a class of clustering methods that seek to build a **hierarchy** of clusters, in which some clusters contain others. In this assignment, we will explore a top-down approach, recursively bipartitioning the data using k-means. **Note to Amazon EC2 users**:...
github_jupyter
# Deep Learning Bootcamp November 2017, GPU Computing for Data Scientists <img src="../images/bcamp.png" align="center"> ## 05 PyTorch Automatic differentiation Web: https://www.meetup.com/Tel-Aviv-Deep-Learning-Bootcamp/events/241762893/ Notebooks: <a href="https://github.com/QuantScientist/Data-Science-PyCUDA-GPU...
github_jupyter
##### Copyright 2020 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
## RIHAD VARIAWA, Data Scientist - Who has fun LEARNING, EXPLORING & GROWING ## Visualizing Matrix Multiplication In the videos on *__Linear Transformation and Matrices__*, you learned how a vector can be decomposed into it's basis vectors $\hat{i}$ and $\hat{j}$. You also learned that you can tranform a vector by mul...
github_jupyter
# Accuracy: Pitfalls and Edge Cases This notebook describes SmartNoise's accuracy calculations, and ways in which an analyst might be tripped up by them. ### Overview #### Accuracy vs. Confidence Intervals Each privatizing mechanism (e.g. Laplace, Gaussian) in SmartNoise has an associated accuracy that is a functi...
github_jupyter
``` # default_exp nlp ``` # NLP > API details. ``` #hide from nbdev.showdoc import * %load_ext autoreload %autoreload 2 %matplotlib inline # export from bs4 import BeautifulSoup from collections import Counter from collections.abc import Iterable from functools import partial from multipledispatch import dispatch im...
github_jupyter
<a href="https://colab.research.google.com/github/constantinpape/dl-teaching-resources/blob/main/exercises/classification/3_multi_layer_perceptron.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Multi-layer Perceptron on CIFAR10 Based on the prev...
github_jupyter
# Constraints Constraints are the second key element of a an optimization problem formulation. They ensure that the optimization results conforms to feasible / realistic solutions. There are three types of constraints in optimization: * Variable bounds - upper and lower boundary values for design variables * inequali...
github_jupyter
#Setup Specify your desired blender version and the path to your blend file within google drive or colab local storage. ###Info If you do need more information on parameters etc. look here: [Blender CLI Wiki](https://docs.blender.org/manual/en/latest/advanced/command_line/arguments.html) ``` #@title Setup #@markdown ...
github_jupyter
``` import pongGym import random import numpy as np import os env = pongGym.DoublePong() PAD_HEIGHT = 80 HALF_PAD_HEIGHT = PAD_HEIGHT // 2 def encode(state): pd1y = state[21] pd2y = state[23] st = [(max(0, state[i*4+0] + state[i*4+2] * 3), abs(state[i*4+1] + state[i*4+3] * 3), state[i*4+2], state[i*4+3]) fo...
github_jupyter
# **Running Pyspark in Colab** To run spark in Colab, we need to first install all the dependencies in Colab environment i.e. Apache Spark 3.0.0 with hadoop 3.2, Java 8 and Findspark to locate the spark in the system. We can use the wget functionality to download these files directly to the current directory. This is...
github_jupyter
``` import string import itertools import numpy as np import pandas as pd import matplotlib.pyplot as plt from tqdm import tqdm_notebook as tqdm from gensim.models import * import tensorflow as tf from tensorflow.keras.utils import * from tensorflow.keras.layers import * from tensorflow.keras.models import * import t...
github_jupyter
Analytic solutions of viscoelastic fluids ====== This notebook outlines and solves for an analytic solution of a viscoelastic material undergoing simple shear. **Simple shear in two dimensions** This model compares the analytic to numeric stored stress of a viscoelastic material undergoing simple shear in two dimens...
github_jupyter
``` library(gdata) library(ggplot2) library(grid) library(gridExtra) DT <- read.table("../Data/All_data.txt") ratio_align <- read.table("../Data/Alignment_ratios_within_regions_across_diseases_wt_sims_patients_metrs_burdens.txt") metr_burden <- "daly" metr_res <- "RCTs" max_plot <- 40 DT$Dis_lab <- DT$Disease levels(DT...
github_jupyter
## Import necessary packages (run once upon startup) ``` from __future__ import division import os import pandas as pd import numpy as np import matplotlib.pyplot as plt plt.style.use("ggplot") %matplotlib inline from skimage.transform import resize from skimage.morphology import skeletonize from scipy.signal impor...
github_jupyter
# Python Language Basics, IPython, and Jupyter Notebooks ``` import numpy as np np.random.seed(12345) np.set_printoptions(precision=4, suppress=True) ``` ## The Python Interpreter ```python $ python Python 3.6.0 | packaged by conda-forge | (default, Jan 13 2017, 23:17:12) [GCC 4.8.2 20140120 (Red Hat 4.8.2-15)] on l...
github_jupyter
## Mini Project # 9 - Handwritten Digit Recognition ### Data Prep, Training and Evaluation ``` import numpy as np import cv2 # Let's take a look at our digits dataset image = cv2.imread('images/digits.png') gray = cv2.cvtColor(image,cv2.COLOR_BGR2GRAY) small = cv2.pyrDown(image) cv2.imshow('Digits Image', small) cv2...
github_jupyter
In this exercise, you will use your new knowledge to propose a solution to a real-world scenario. To succeed, you will need to import data into Python, answer questions using the data, and generate **line charts** to understand patterns in the data. ## Scenario You have recently been hired to manage the museums in th...
github_jupyter
<img src="../Master/NotebookAddons/blackboard-banner.png" width="100%" /> <font face="Calibri"> <br> <font size="6"> <b>Flood Mapping from Single Sentinel-1 SAR Images</b><img style="padding: 7px" src="../Master/NotebookAddons/UAFLogo_A_647.png" width="170" align="right"/></font> <br> <font size="4"> <b> Franz J Meyer...
github_jupyter
# Channel combination with Siemens twix data In our previous example, we loaded data from the Siemens RDA format. While this is the default format for exporting MRS data from the scanner, Siemens also supports exporting the data in the twix format, which contains the true raw data before any processing is done to it. ...
github_jupyter
### <b> 1. Install some Libraries </b> ``` gpu_info = !nvidia-smi gpu_info = '\n'.join(gpu_info) if gpu_info.find('failed') >= 0: print('Select the Runtime > "Change runtime type" menu to enable a GPU accelerator, ') print('and then re-execute this cell.') else: print(gpu_info) from psutil import virtual_m...
github_jupyter
# CANDO Tutorial This notebook will walk you through how to generate a CANDO matrix, set up a CANDO object, probe the data, benchmark the platform, and make therapeutic predictions. ## ToC * [Introduction](#intro) * [Get Started](#get-started) * [Generate interaction matrix](#interaction-matrix) * [Setting up CANDO ...
github_jupyter
``` import csv meta_table = [] with open('meta_table.csv', newline='') as csvfile: reader = csv.reader(csvfile, delimiter=',') for row in reader: meta_table += [row] lang_to_sizes = {} orig_lang = {} for name, size_str, _, _, lang in meta_table[1:]: if lang.startswith('zh'): orig_lang[n...
github_jupyter
``` import os import json ``` This notebook creates a dataset (images and labels as a json file). The dataset created can be used for pose classification. In order to create a new dataset for gesture recoginition specify the following parameters **no_of_classes** - Number of classes to be created. i.e. For hand p...
github_jupyter
<img src="https://www.microsoft.com/en-us/research/uploads/prod/2020/05/Attribution.png" width="400"> <h1 align="left">Multi-investment Attribution: Distinguish the Effects of Multiple Outreach Efforts</h1> A startup that sells software would like to know whether its multiple outreach efforts were successful in attra...
github_jupyter
# **02. Computing HDX deuterated fractions from MD simulations** ``` import os import numpy as np import pandas as pd import matplotlib.pyplot as plt from scipy.stats import linregress # Matplotlib settings for plotting plt.rc('lines', linewidth=3, markersize=4) plt.rc('axes', labelweight='heavy', labelsize=22, titles...
github_jupyter
``` import pandas as pd import numpy as np import calendar import re ``` ### Import Datasets ``` #Import Covid Dataset ds_covid = pd.read_csv("Data/COVID/owid-covid-data.csv") #If missing values: Interpolate: ds_covid = ds_covid.interpolate(method='nearest') ds_covid = ds_covid.fillna(0) ds_covid.date = pd.to_dateti...
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=Science/HeatAndTemperature/heat-and-tem...
github_jupyter
``` %pylab inline %config InlineBackend.figure_format='retina' from scipy.integrate import cumtrapz from scipy.interpolate import interp1d import seaborn as sns sns.set_context('notebook') sns.set_style('ticks') sns.set_palette('colorblind') ``` Some $\LaTeX$ macros: $$ \DeclareMathOperator{\erf}{erf} $$ This simpl...
github_jupyter
### Common imports ``` import ipywidgets as widgets import matplotlib.pyplot as plt import numpy as np %matplotlib notebook from IPython.display import display ``` ### Spline Policy ``` import sys import os sys.path.insert(0, "/home/giuseppe/catkin_ws/src/sampling_based_control/mppi/python") import numpy as np im...
github_jupyter
# CAPÍTULO 04 - Variáveis e Tipos de Dados ``` #1. Faça um programa que leia um número inteiro e o imprima. a = 10 b = type(a) print(a) print(b) #3. Peça ao usuário para digitar três valores inteiros e imprima a soma deles. a = input('Informe o primeiro valor inteiro:') b = input('Informe o segundo valor inteiro:') c ...
github_jupyter
``` import pickle import sys sys.path.append("../") import warnings warnings.filterwarnings('ignore') import pandas as pd import numpy as np import tensorflow as tf from sklearn.metrics import mean_squared_error, mean_absolute_error from math import sqrt from surprise import accuracy from reco_utils.dataset.python_sp...
github_jupyter
# Bar data ``` from ib_insync import * util.startLoop() ib = IB() ib.connect('127.0.0.1', 7497, clientId=15) ``` ## Historical data To get the earliest date of available bar data the "head timestamp" can be requested: ``` contract = Stock('AMC', 'ISLAND', 'USD') ib.reqHeadTimeStamp(contract, whatToShow='TRADES', ...
github_jupyter
Deep Learning Models -- A collection of various deep learning architectures, models, and tips for TensorFlow and PyTorch in Jupyter Notebooks. - Author: Sebastian Raschka - GitHub Repository: https://github.com/rasbt/deeplearning-models ``` %load_ext watermark %watermark -a 'Sebastian Raschka' -v -p torch ``` # Model...
github_jupyter
## <strong>Introduction of linear Algebra using NumPy library</strong> NumPy, which stands for Numerical Python, is a library consisting of multidimensional array objects and a collection of routines for processing those arrays. Using NumPy, mathematical and logical operations on arrays can be performed.It also has fun...
github_jupyter
# Indexing and Slicing <h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Indexing-and-Slicing" data-toc-modified-id="Indexing-and-Slicing-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Indexing and Slicing</a></span><ul class="toc-item"><li><span><a hr...
github_jupyter
``` from pyspark import SparkConf, SparkContext from pyspark.sql import SparkSession from pyspark.sql import * from pyspark.sql.types import * from pyspark.sql.functions import udf from pyspark.sql.functions import * from pyspark.sql.window import Window NoneType = type(None) import os import socket import hashlib impo...
github_jupyter
## Facial Filters Using your trained facial keypoint detector, you can now do things like add filters to a person's face, automatically. In this optional notebook, you can play around with adding sunglasses to detected face's in an image by using the keypoints detected around a person's eyes. Checkout the `images/` di...
github_jupyter
## Closed-loop batch, constrained BO in BoTorch with qEI and qNEI In this tutorial, we illustrate how to implement a simple Bayesian Optimization (BO) closed loop in BoTorch. In general, we recommend for a relatively simple setup (like this one) to use Ax, since this will simplify your setup (including the amount of ...
github_jupyter
<a href="https://colab.research.google.com/github/Tessellate-Imaging/monk_v1/blob/master/study_roadmaps/1_getting_started_roadmap/5_update_hyperparams/2_data_params/1)%20Change%20batch%20sizes%20from%20default%20state.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open ...
github_jupyter
# Introduction to optimization The basic components * The objective function (also called the 'cost' function) ``` import numpy as np objective = np.poly1d([1.3, 4.0, 0.6]) print(objective) ``` * The "optimizer" ``` import scipy.optimize as opt x_ = opt.fmin(objective, [3]) print("solved: x={}".format(x_)) %matplo...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Qcodes-example-with-Keysight-B1500-Semiconductor-Parameter-Analyzer" data-toc-modified-id="Qcodes-example-with-Keysight-B1500-Semiconductor-Parameter-Analyzer-1"><span class="toc-item-num">1&nbsp;&nbsp;</sp...
github_jupyter
``` ### This file contains the implementation of the Support Vector Machine Classification on the ### Digit Recongition Dataset. ### Below are the libraries used for the implementation. ### @Author: Chaitanya Sri Krishna Lolla. from sklearn import svm import csv import numpy as np ## TLoading the training Dataset into...
github_jupyter
<!--NAVIGATION--> < [Installation](Installation.ipynb) | [Index](Index.ipynb) | [Catalog](Catalog.ipynb) > <a href="https://colab.research.google.com/github/simonscmap/pycmap/blob/master/docs/API.ipynb"><img align="left" src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab" title="Open and...
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
``` import pandas as pd import numpy as np # TIMES rng = pd.date_range('2016 Jul 1', periods = 10, freq = 'D') rng # Which of these formats DON'T work? #'2016 Jul 1', '7/1/2016', '1/7/2016', 'July 1, 2016', '2016-07-01', '2016/07/01' rng = pd.date_range('7/1/2016', periods = 10, freq = 'D') rng rng = pd.date_range('1/7...
github_jupyter
<a href="https://colab.research.google.com/github/jeffheaton/t81_558_deep_learning/blob/master/assignments/assignment_yourname_class2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # T81-558: Applications of Deep Neural Networks * Instructor: [Jeff...
github_jupyter
<a href="https://colab.research.google.com/github/Tessellate-Imaging/Monk_Object_Detection/blob/master/example_notebooks/inference_engine/Object%20Detection%20-%20EfficientDet%20Pytorch.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Installation ...
github_jupyter
# Introduction to py-tedopa This package consists of different files, each serving a different purpose. **tedopa.py** provides functions to first map the Hamiltonian of an open quantum system, linearly coupled to an environment of continuous bosonic modes, to a one dimensional chain and then perform time evolution on...
github_jupyter
``` #@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" } # 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,...
github_jupyter
# Table of Contents <p><div class="lev1 toc-item"><a href="#Intelligent-Agents" data-toc-modified-id="Intelligent-Agents-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Intelligent Agents</a></div><div class="lev2 toc-item"><a href="#Agents-and-Environments" data-toc-modified-id="Agents-and-Environments-11"><span cl...
github_jupyter
<small><small><i> All the IPython Notebooks in this **Python Examples** series by Dr. Milaan Parmar are available @ **[GitHub](https://github.com/milaan9/90_Python_Examples)** </i></small></small> # Python Program to Find Hash of File In this example, you'll learn to find the hash of a file and display it. To unders...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Objectives" data-toc-modified-id="Objectives-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Objectives</a></span><ul class="toc-item"><li><span><a href="#Agenda" data-toc-modified-id="Agenda-1.1"><span c...
github_jupyter
# Variability analysis for HBEC IFN experiment ``` import scanpy as sc import seaborn as sns import pandas as pd import matplotlib.pyplot as plt import numpy as np import scipy.stats as stats from pybedtools import BedTool import pickle as pkl %matplotlib inline import itertools import sys sys.path.append('/home/ssm-u...
github_jupyter
``` # !apt-get install libgeos-3.5.0 # !apt-get install libgeos-dev # !pip install https://github.com/matplotlib/basemap/archive/master.zip #from google.colab import drive #drive.mount('/content/drive') ``` # OCO2 - Analyze the CO² plume of Laiwu city Project for **Data For Good**, season 7. *By Quentin Kamenda, Be...
github_jupyter
``` import os os.environ['CUDA_VISIBLE_DEVICES'] = "0" import numpy as np from matplotlib import pyplot as plt import seaborn as sns import pandas as pd from tqdm.auto import tqdm import torch from torch import nn import gin import pickle import io from sparse_causal_model_learner_rl.trainable.gumbel_switch import With...
github_jupyter
# DataSynthesizer Usage (independent attribute mode) > This is a quick demo to use DataSynthesizer in independent attribute mode. ### Step 1 import packages ``` from DataSynthesizer.DataDescriber import DataDescriber from DataSynthesizer.DataGenerator import DataGenerator from DataSynthesizer.ModelInspector import M...
github_jupyter
``` import tensorflow as tf import csv import os print(tf.__version__) train_data_files = ['data/train-data.csv'] valid_data_files = ['data/valid-data.csv'] test_data_files = ['data/test-data.csv'] HEADER = ['key','x','y','alpha','beta','target'] HEADER_DEFAULTS = [[0], [0.0], [0.0], ['NA'], ['NA'], [0.0]] NUMERIC_FE...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Filter/filter_range_contains.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target="_blank" ...
github_jupyter
This notebook was prepared by [Donne Martin](http://donnemartin.com). Source and license info is on [GitHub](https://github.com/donnemartin/interactive-coding-challenges). # Solution Notebook ## Problem: Implement insertion sort. * [Constraints](#Constraints) * [Test Cases](#Test-Cases) * [Algorithm](#Algorithm) * [...
github_jupyter
# Day2 ## Importing heavenly Bodies ``` #time to call the gods import pandas as pd from sklearn import preprocessing import numpy as np %matplotlib notebook import matplotlib.pyplot as plt import matplotlib.ticker as ticker import seaborn as sns ``` ## Data Loading ``` def preprocess_df(df): processed_df = df.c...
github_jupyter
``` # default_exp models.TSTPlus ``` # TSTPlus (Time Series Transformer) > This is an unofficial PyTorch implementation created by Ignacio Oguiza (timeseriesAI@gmail.com) based on TST (Zerveas, 2020) and Transformer (Vaswani, 2017). **References:** This is an unofficial PyTorch implementation by Ignacio Oguiza of ...
github_jupyter
### Prior and Posterior $$A \sim \cal{N}(0,s I)$$ $$q(A) =\cal{N}(\mu_A, \Lambda_A)$$ ### Likelihood $$Y|A,X = Y|A^T X$$ ``` import tensorflow as tf import os import numpy as np from tqdm import tqdm from matplotlib import pyplot as plt from matplotlib import cm tf.logging.set_verbosity(tf.logging.ERROR) np.random.se...
github_jupyter