text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
** ----- IMPORTANT ------ ** The code presented here assumes that you're running TensorFlow v1.3.0 or higher, this was not released yet so the easiet way to run this is update your TensorFlow version to TensorFlow's master. To do that go [here](https://github.com/tensorflow/tensorflow#installation) and then exec...
github_jupyter
``` from autoreduce import * import numpy as np from sympy import symbols # Post conservation law and other approximations phenomenological model at the RNA level n = 4 # Number of states nouts = 2 # Number of outputs # Inputs by user x_init = np.zeros(n) n = 4 # Number of states timepoints_ode = np.linspace(0, 100...
github_jupyter
# Understanding the FFT Algorithm Copy from http://jakevdp.github.io/blog/2013/08/28/understanding-the-fft/ *This notebook first appeared as a post by Jake Vanderplas on [Pythonic Perambulations](http://jakevdp.github.io/blog/2013/08/28/understanding-the-fft/). The notebook content is BSD-licensed.* <!-- PELICAN_BEG...
github_jupyter
``` # default_exp label ``` # Label > A collection of functions to do label-based quantification ``` #hide from nbdev.showdoc import * ``` ## Label search The label search is implemented based on the compare_frags from the search. We have a fixed number of reporter channels and check if we find a respective peak ...
github_jupyter
``` import numpy as np import pandas as pd import warnings warnings.filterwarnings('ignore') import seaborn as sns sns.set_palette('Set2') import matplotlib.pyplot as plt %matplotlib inline from sklearn.metrics import confusion_matrix, mean_squared_error from sklearn.preprocessing import LabelEncoder, MinMaxScaler, ...
github_jupyter
# Numpy ### GitHub repository: https://github.com/jorgemauricio/curso_itesm ### Instructor: Jorge Mauricio ``` # librerías import numpy as np ``` # Crear Numpy Arrays ## De una lista de python Creamos el arreglo directamente de una lista o listas de python ``` my_list = [1,2,3] my_list np.array(my_list) my_matrix ...
github_jupyter
``` import os import numpy as np import pandas as pd import glob from prediction_utils.util import yaml_read, df_dict_concat table_path = '../figures/hyperparameters/' os.makedirs(table_path, exist_ok = True) param_grid_base = { "lr": [1e-3, 1e-4, 1e-5], "batch_size": [128, 256, 512], "drop_prob...
github_jupyter
# 时间序列预测 时间序列是随着时间的推移定期收集的数据。时间序列预测是指根据历史数据预测未来数据点的任务。时间序列预测用途很广泛,包括天气预报、零售和销量预测、股市预测,以及行为预测(例如预测一天的车流量)。时间序列数据有很多,识别此类数据中的模式是很活跃的机器学习研究领域。 <img src='notebook_ims/time_series_examples.png' width=80% /> 在此 notebook 中,我们将学习寻找时间规律的一种方法,即使用 SageMaker 的监督式学习模型 [DeepAR](https://docs.aws.amazon.com/sagemaker/latest/dg/deep...
github_jupyter
### Netflix Scrapper The purpose of the code is to get details of all the Categories on Netflix and then to gather information about Sub-Categories and movies under each Sub-Category. ``` from bs4 import BeautifulSoup import requests import pandas as pd import numpy as np def make_soup(url): return BeautifulSoup(...
github_jupyter
# Explain Attacking BERT models using CAptum Captum is a PyTorch library to explain neural networks Here we show a minimal example using Captum to explain BERT models from TextAttack [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/QData/TextAttack/...
github_jupyter
``` import pandas as pd import datetime import vk_api import os import requests import json import random %matplotlib inline import matplotlib.pyplot as plt import seaborn as sns import sys token = '4e6e771d37dbcbcfcc3b53d291a274d3ae21560a2e81f058a7c177aff044b5141941e89aff1fead50be4f' vk_session = vk_api.VkApi(token=t...
github_jupyter
# Software Analytics Mini Tutorial Part I: Jupyter Notebook and Python basics ## Introduction This series of notebooks are a simple mini tutorial to introduce you to the basic functionality of Jupyter, Python, pandas and matplotlib. The comprehensive explanations should guide you to be able to analyze software data on...
github_jupyter
``` ## plot the histogram showing the modeled and labeled result import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib inline # for loop version def read_comp(file): Pwave = {} Pwave['correct'] = [] Pwave['wrongphase'] = [] Pwave['miss'] = 0 Pwave['multiphase'] = [] ...
github_jupyter
``` %matplotlib inline ``` torchaudio Tutorial =================== PyTorch is an open source deep learning platform that provides a seamless path from research prototyping to production deployment with GPU support. Significant effort in solving machine learning problems goes into data preparation. ``torchaudio`` le...
github_jupyter
# EEP/IAS 118 - Section 6 ## Fixed Effects Regression ### August 1, 2019 Today we will practice with fixed effects regressions in __R__. We have two different ways to estimate the model, and we will see how to do both and the situations in which we might favor one versus the other. Let's give this a try using the d...
github_jupyter
# SVM Classification Using Individual Replicas This notebook analyzes the quality of the classifiers resulting from training on individual replicas of read counts rather than averaged values. Data are adjusted for library size and gene length. Training data 1. Uses individual replicas (not averaged) 1. Uses all genes ...
github_jupyter
# Inference in Google Earth Engine + Colab > Scaling up machine learning with GEE and Google Colab. - toc: true - badges: true - author: Drew Bollinger - comments: false - hide: false - sticky_rank: 11 # Inference in Google Earth Engine + Colab Here we demonstrate how to take a trained model and apply to to imagery...
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>From Understanding to Preparation</font></h1> ## Introduction In this lab, we will continue learning about the data science methodology, and focus ...
github_jupyter
# Autoencoder (Semi-supervised) ``` %load_ext autoreload %autoreload 2 # Seed value # Apparently you may use different seed values at each stage seed_value= 0 # 1. Set the `PYTHONHASHSEED` environment variable at a fixed value import os os.environ['PYTHONHASHSEED']=str(seed_value) # 2. Set the `python` built-in pseu...
github_jupyter
# Facial Keypoint Detection This project will be all about defining and training a convolutional neural network to perform facial keypoint detection, and using computer vision techniques to transform images of faces. The first step in any challenge like this will be to load and visualize the data you'll be working ...
github_jupyter
``` import os import pickle import re import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sn import numpy as np import re import xgboost as xgb import shap from sklearn import ensemble from sklearn import dummy from sklearn import linear_model from sklearn import svm from sklearn...
github_jupyter
# 2.4 Deep Taylor Decomposition Part 2. ## Tensorflow Walkthrough ### 1. Import Dependencies I made a custom `Taylor` class for Deep Taylor Decomposition. If you are interested in the details, check out `models_3_2.py` in the models directory. ``` import os import re from tensorflow.examples.tutorials.mnist import...
github_jupyter
# Initialization Welcome to the first assignment of "Improving Deep Neural Networks". Training your neural network requires specifying an initial value of the weights. A well chosen initialization method will help learning. If you completed the previous course of this specialization, you probably followed our ins...
github_jupyter
``` # The usual preamble %matplotlib inline import pandas as pd import matplotlib.pyplot as plt import numpy as np # Make the graphs a bit prettier, and bigger plt.style.use('ggplot') plt.rcParams['figure.figsize'] = (15, 5) plt.rcParams['font.family'] = 'sans-serif' # This is necessary to show lots of columns in pa...
github_jupyter
``` import boto3 import sagemaker import time import pandas as pd import numpy as np role = sagemaker.get_execution_role() region = boto3.Session().region_name sagemaker_session = sagemaker.Session() bucket_name = sagemaker_session.default_bucket() prefix = 'endtoendmlsm' print(region) print(role) print(bucket_name) ...
github_jupyter
--- title: "Create empty feature groups for Online Feature Store" date: 2021-04-25 type: technical_note draft: false --- ``` import json from pyspark.sql.types import StructField, StructType, StringType, DoubleType, TimestampType, LongType, IntegerType ``` # Create empty feature groups In this demo example we are ex...
github_jupyter
# Freesurfer space to native space using `mri_vol2vol` BMED360-2021: `freesurfer-to-native-space.ipynb` ``` %matplotlib inline import os import pathlib import pandas as pd import numpy as np import matplotlib.pyplot as plt import nibabel as nib from os.path import expanduser, join, basename, split import sys sys.path...
github_jupyter
# Tokenizers ``` ! pipenv install nltk import nltk from nltk import tokenize s1 = """Why wase time say lot word when few word do trick?""" s2 = """Hickory dickory dock, the mouse ran up the clock.""" from nltk.tokenize import word_tokenize ! df -h /home/christangrant/nltk_data # nltk.download('punkt') # Download the m...
github_jupyter
``` %load_ext autoreload %autoreload 2 from IPython.display import Markdown, display def printmd(string): display(Markdown(string)) def colorize(string,color="red"): return f"<span style=\"color:{color}\">{string}</span>" ``` # Problem description ### Subtask2: Detecting antecedent and consequence Indi...
github_jupyter
``` import numpy as np import scipy.io as sio from sklearn import svm from sklearn.model_selection import cross_val_score from sklearn.metrics.pairwise import pairwise_distances from sklearn import manifold import matplotlib.pyplot as plt from sklearn.decomposition import PCA from sklearn.svm import SVC from graph_kern...
github_jupyter
# Phase 2 Review ``` import pandas as pd import numpy as np from sklearn.preprocessing import StandardScaler from statsmodels.formula.api import ols pd.set_option('display.max_columns', 100) ``` ### Check Your Data … Quickly The first thing you want to do when you get a new dataset, is to quickly to verify the conte...
github_jupyter
# Stirlingの公式(対数近似) * $\log n! \sim n\log n - n$ * $n!$はおおよそ$\left(\frac{n}{e}\right)^n$になる * 参考: [スターリングの公式(対数近似)の導出](https://starpentagon.net/analytics/stirling_log_formula/) ``` import numpy as np import pandas as pd import matplotlib.pyplot as plt ``` ## $\log n!$の上からの評価 ``` MIN_X = 0.5 MAX_X = 10 x = np.linsp...
github_jupyter
# Part 1: Extracting a Journal's Publications+Researchers Datasets In this notebook we are going to * extract all publications data for a given journal * have a quick look at the publications' authors and affiliations * review how many authors have been disambiguated with a Dimensions Researcher ID * produce a data...
github_jupyter
Your name here. Your section number here. # Workshop 1: Python basics, and a little plotting **Submit this notebook to bCourses to receive a grade for this Workshop.** Please complete workshop activities in code cells in this iPython notebook. The activities titled **Practice** are purely for you to explore Python...
github_jupyter
## Recursive Functions A recursive function is a function that makes calls to itself. It works like the loops we described before, but sometimes it the situation is better to use recursion than loops. Every recursive function has two components: a base case and a recursive step. The base case is usually the smallest ...
github_jupyter
``` from astropy.constants import G import astropy.coordinates as coord import astropy.table as at import astropy.units as u from astropy.time import Time import matplotlib as mpl import matplotlib.pyplot as plt %matplotlib inline import numpy as np from gala.units import galactic, UnitSystem from twobody import TwoBo...
github_jupyter
Peakcalling Bam Stats and Filtering Report - Insert Sizes ================================================================ This notebook is for the analysis of outputs from the peakcalling pipeline There are severals stats that you want collected and graphed (topics covered in this notebook in bold). These are: ...
github_jupyter
``` import keras from keras.models import Sequential, Model, load_model from keras.layers import Dense, Dropout, Flatten, Input, Lambda, Concatenate from keras.layers import Conv1D, MaxPooling1D from keras.callbacks import ModelCheckpoint, EarlyStopping from keras import backend as K import keras.losses import tensorf...
github_jupyter
# Working with MODFLOW-NWT v 1.1 option blocks In MODFLOW-NWT an option block is present for the WEL file, UZF file, and SFR file. This block takes keyword arguments that are supplied in an option line in other versions of MODFLOW. The `OptionBlock` class was created to provide combatibility with the MODFLOW-NWT opt...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Matplotlib" data-toc-modified-id="Matplotlib-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Matplotlib</a></span><ul class="toc-item"><li><span><a href="#Customization" data-toc-modified-id="Customizatio...
github_jupyter
``` import seaborn as sns import pandas as pd import numpy as np import altair as alt from markdown import markdown from IPython.display import Markdown from ipywidgets.widgets import HTML, Tab from ipywidgets import widgets from datetime import timedelta from matplotlib import pyplot as plt import os.path as op from ...
github_jupyter
# Introduction to Logistic Regression ## Learning Objectives 1. Create Seaborn plots for Exploratory Data Analysis 2. Train a Logistic Regression Model using Scikit-Learn ## Introduction This lab is an introduction to logistic regression using Python and Scikit-Learn. This lab serves as a foundation for more...
github_jupyter
# Generative Adversarial Network In this notebook, we'll be building a generative adversarial network (GAN) trained on the MNIST dataset. From this, we'll be able to generate new handwritten digits! GANs were [first reported on](https://arxiv.org/abs/1406.2661) in 2014 from Ian Goodfellow and others in Yoshua Bengio'...
github_jupyter
``` """ We use following lines because we are running on Google Colab If you are running notebook on a local computer, you don't need this cell """ from google.colab import drive drive.mount('/content/gdrive') import os os.chdir('/content/gdrive/My Drive/finch/tensorflow1/free_chat/chinese/main') %tensorflow_version 1....
github_jupyter
# PyIndMach012: an example of user-model using DSS Python This example runs a modified example from the OpenDSS distribution for the induction machine model with a sample PyIndMach012 implementation, written in Python, and the original, built-in IndMach012. Check the `PyIndMach012.py` file for more comments. Comparin...
github_jupyter
# A Two-Level, Six-Factor Full Factorial Design <br /> <br /> <br /> ### Table of Contents * [Introduction](#intro) * Factorial Experimental Design: * [Two-Level Six-Factor Full Factorial Design](#fullfactorial) * [Variables and Variable Labels](#varlabels) * [Computing Main and Interaction Effects](#computing_ef...
github_jupyter
<a href="https://colab.research.google.com/github/NikolaZubic/AppliedGameTheoryHomeworkSolutions/blob/main/domaci3.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # TREĆI DOMAĆI ZADATAK iz predmeta "Primenjena teorija igara" (Applied Game Theory) R...
github_jupyter
``` # Copyright 2021 NVIDIA Corporation. All Rights Reserved. # # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
github_jupyter
``` import sys sys.path.append('..') # for import src import os import cloudpickle import lzma import pandas as pd import numpy as np from sklearn.linear_model import Ridge from sklearn.model_selection import cross_val_predict from scipy.stats import pearsonr import matplotlib.pyplot as plt import lightgbm as lgb impo...
github_jupyter
# Packages ``` #!/usr/bin/env python # coding: utf-8 import requests import numpy as np import json import os import time as tm import pandas as pd import http.client import io import boto3 import zipfile from threading import Thread import logging from datetime import datetime import time from operator import itemget...
github_jupyter
# DJL BERT Inference Demo ## Introduction In this tutorial, you walk through running inference using DJL on a [BERT](https://towardsdatascience.com/bert-explained-state-of-the-art-language-model-for-nlp-f8b21a9b6270) QA model trained with MXNet. You can provide a question and a paragraph containing the answer to the...
github_jupyter
# Run Train of Bubble-Agent (DQN) - Team: TToBoT - Member: { Sejun, Steve, Victor } @kaist ## Objective - run training simultaneously w/ notebook - to compare the performance of traing ## For Competition 1. prepare the final trained IQN Model (checkpoint w/ 100 iteration) 2. need to customize of env.step() - ...
github_jupyter
``` import sys, os; sys.path.append('..') import pyzx as zx import random import math from fractions import Fraction %config InlineBackend.figure_format = 'svg' c = zx.qasm(""" qreg q[3]; cx q[0], q[1]; """) zx.d3.draw(c) c = zx.qasm(""" qreg q[2]; rx(0.5*pi) q[1]; t q[0]; cx q[0], q[1]; cx q[1], q[0]; cx q[0], q[1]; t...
github_jupyter
# PDOS data analysis and plotting --- ### Import Modules ``` import os print(os.getcwd()) import sys import plotly.graph_objs as go import matplotlib.pyplot as plt from scipy import stats # ######################################################### from methods import get_df_features_targets from proj_data import ...
github_jupyter
### Basic Functions for Interactively Exploring the CORTX Metrics Stored in Pickles ``` %cd /home/johnbent/cortx/metrics import cortx_community import cortx_graphing import os from github import Github gh = Github(os.environ.get('GH_OATH')) stx = gh.get_organization('Seagate') repos = cortx_community.get_repos() ps = ...
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
# Language Translation In this project, you’re going to take a peek into the realm of neural network machine translation. You’ll be training a sequence to sequence model on a dataset of English and French sentences that can translate new sentences from English to French. ## Get the Data Since translating the whole lan...
github_jupyter
<a href="https://colab.research.google.com/github/yohanesnuwara/machine-learning/blob/master/06_simple_linear_regression/simple_linear_reg_algorithm.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # **Simple Linear Regression** ``` import numpy as ...
github_jupyter
``` import matplotlib.pyplot as plt %matplotlib inline import pickle import numpy as np from scipy.spatial.distance import pdist, squareform with open('exp_features.p', 'rb') as f: data = pickle.load(f) ``` ## visualize ``` def get_continuous_quantile(x, y, n_interval=100, q=1): """ Take continuous x and...
github_jupyter
``` print("Hello world!") a=10 a b=5 b #addition demo sum=a+b print("the sum of a and b is:",sum) x=2**3 x y=5/2 y y=5//2 y input("Enter some variable") a=int(input("enter the first number")) b=int(input("enter the second number")) int("The sum of first number and second number is:",a+b) int("The difference of the fi...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt from IPython.core.display import display, HTML plt.style.use('fivethirtyeight') plt.rc('figure', figsize=(5.0, 2.0)) pokemon=pd.read_csv("../dataset/pokemon.csv") # Which pokémon is the most difficult to catch? pokemon['capture_rate']=pd.to_num...
github_jupyter
``` import random import gym #import math import numpy as np from collections import deque import tensorflow as tf from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Conv2D, MaxPooling2D, Flatten from tensorflow.keras.optimizers import Adam EPOCHS = 1000 THRESHOLD = 10 MONITOR = T...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import glob import sys import argparse as argp change_50_dat = pd.read_csv('/Users/leg2015/workspace/Aagos/Data/Mut_Treat_Change_50_CleanedDataStatFit.csv', index_col="update", float_precision="high") change_0_dat = pd.read...
github_jupyter
# Deploy model **Important**: Change the kernel to *PROJECT_NAME local*. You can do this from the *Kernel* menu under *Change kernel*. You cannot deploy the model using the *PROJECT_NAME docker* kernel. ``` from azureml.api.schema.dataTypes import DataTypes from azureml.api.schema.sampleDefinition import SampleDefinit...
github_jupyter
# DiFuMo (Dictionaries of Functional Modes) <div class="alert alert-block alert-danger"> <b>NEW:</b> New in release 0.7.1 </div> ## Outline - <a href="#descr">Description</a> - <a href="#howto">Description</a> - <a href="#closer">Coser look on the object</a> - <a href="#visualize">Visualize</a> <span id="descr"></s...
github_jupyter
# Tutorial 06: Networks from OpenStreetMap In this tutorial, we discuss how networks that have been imported from OpenStreetMap can be integrated and run in Flow. This will all be presented via the Bay Bridge network, seen in the figure below. Networks from OpenStreetMap are commonly used in many traffic simulators fo...
github_jupyter
<table width="100%"> <tr> <td style="background-color:#ffffff;"> <a href="http://qworld.lu.lv" target="_blank"><img src="../images/qworld.jpg" width="35%" align="left"> </a></td> <td style="background-color:#ffffff;vertical-align:bottom;text-align:right;"> prepared by Abuzer Yak...
github_jupyter
``` # Execute this code block to install dependencies when running on colab try: import torch except: from os.path import exists from wheel.pep425tags import get_abbr_impl, get_impl_ver, get_abi_tag platform = '{}{}-{}'.format(get_abbr_impl(), get_impl_ver(), get_abi_tag()) cuda_output = !ldconfig -...
github_jupyter
``` from crystal_toolkit.helpers.layouts import Columns, Column from crystal_toolkit.settings import SETTINGS from jupyter_dash import JupyterDash from pydefect.analyzer.calc_results import CalcResults from pydefect.analyzer.dash_components.cpd_energy_dash import CpdEnergy2D3DComponent, CpdEnergyOtherComponent from pyd...
github_jupyter
# V2: SCF optimization with VAMPyR ## V2.1: Hydrogen atom In order to solve the one-electron Schr\"{o}dinger equation in MWs we reformulate them in an integral form [1]. \begin{equation} \phi = -2\hat{G}_{\mu}\hat{V}\phi \end{equation} Where $\hat{V}$ is the potential acting on the system, $\phi$ is the wavefuncti...
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
# Módulo 2 - Modelos preditivos e séries temporais # Desafio do Módulo 2 ``` import pandas as pd import numpy as np base = pd.read_csv('https://pycourse.s3.amazonaws.com/banknote_authentication.txt', header=None) base.head() #labels: #variance, skewness, curtosis e entropy) base.columns=['variance', 'skewness', 'curt...
github_jupyter
<img src="../../images/banners/python-advanced.png" width="600"/> # <img src="../../images/logos/python.png" width="23"/> Python's property(): Add Managed Attributes to Your Classes ## <img src="../../images/logos/toc.png" width="20"/> Table of Contents * [Managing Attributes in Your Classes](#managing_attributes_in...
github_jupyter
# iMCSpec (iSpec+emcee) iMCSpec is a tool which combines iSpec(https://www.blancocuaresma.com/s/iSpec) and emcee(https://emcee.readthedocs.io/en/stable/) into a single unit to perform Bayesian analysis of spectroscopic data to estimate stellar parameters. For more details on the individual code please refer to the lin...
github_jupyter
<a href="https://colab.research.google.com/github/ryanleeallred/DS-Unit-1-Sprint-1-Dealing-With-Data/blob/master/module2-loadingdata/LS_DS_112_Loading_Data_Assignment.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Practice Loading Datasets This ...
github_jupyter
``` ################################### # Test cell, pyechonest - IO HAVOC ################################### import os import sys sys.path.append(os.environ["HOME"] + "/github/pyechonest") import pyechonest.track as track import pyechonest.artist as artist import pyechonest.util as util import pyechonest.song as son...
github_jupyter
[@LorenaABarba](https://twitter.com/LorenaABarba) 12 steps to Navier–Stokes ===== *** Did you experiment in Steps [1](./01_Step_1.ipynb) and [2](./02_Step_2.ipynb) using different parameter choices? If you did, you probably ran into some unexpected behavior. Did your solution ever blow up? (In my experience, CFD stud...
github_jupyter
# Likelihood for Retro To calculate the likelihood of a hypothesis $H$ given observed data $\boldsymbol{k}$, we construct the extended likelihood given as: $$\large L(H|\boldsymbol{k}) = \prod_{i\in\text{DOMs}} \frac{\lambda_i^{k_i}} {k_i!} e^{-\lambda_i} \prod_{j\in\text{hits}}p^j(t_j|H)^{k_j}$$ where: * $\lambda_i...
github_jupyter
``` import numpy as np import pandas as pd from grn_learn.viz import set_plotting_style import seaborn as sns import matplotlib.pyplot as plt from grn_learn import download_and_preprocess_data from grn_learn import annot_data_trn from grn_learn import train_keras_multilabel_nn from sklearn.model_selection import St...
github_jupyter
# Batch Normalization – Lesson 1. [What is it?](#theory) 2. [What are it's benefits?](#benefits) 3. [How do we add it to a network?](#implementation_1) 4. [Let's see it work!](#demos) 5. [What are you hiding?](#implementation_2) # What is Batch Normalization?<a id='theory'></a> Batch normalization was introduced in ...
github_jupyter
``` import logging import os import math from dataclasses import dataclass, field import copy # for deep copy import torch from torch import nn from transformers import RobertaForMaskedLM, RobertaTokenizerFast, TextDataset, DataCollatorForLanguageModeling, Trainer from transformers import TrainingArguments, HfArgumen...
github_jupyter
# Numerical norm bounds for quadrotor For a quadrotor system with state $x = \begin{bmatrix}p_x & p_z & \phi & v_x & v_z & \dot{\phi} \end{bmatrix}^T$ we have \begin{equation} \dot{x} = \begin{bmatrix} v_x \cos\phi - v_z\sin\phi \\ v_x \sin\phi + v_z\cos\phi \\ \dot{\phi} \\ v_z\dot{\phi} - g\sin{\phi} \\ -v_x\dot{...
github_jupyter
# Expectiminimax Der Vollständigkeits halber der ganze Expectiminimax Algorithmus. <br> Während 1-ply, 2-ply und 3-ply nur den ersten, die ersten beiden, bzw. ersten drei Schritte von Expectiminimax ausgeführt haben, kann man alle mit dem Expectiminmax Algorithmus zusammenfassen. Das erlaubt einem eine saubere Notatio...
github_jupyter
``` import os, json from pathlib import Path from pandas import DataFrame from mpcontribs.client import Client from unflatten import unflatten client = Client() ``` **Load raw data** ``` name = "screening_inorganic_pv" indir = Path("/Users/patrick/gitrepos/mp/mpcontribs-data/ThinFilmPV") files = { "summary": "SUM...
github_jupyter
``` import torch from torch import nn from torch import optim from torchvision.datasets import MNIST from torch.utils.data import TensorDataset, Dataset, DataLoader from tqdm.notebook import tqdm import numpy as np from aijack.defense import VIB, KL_between_normals, mib_loss dim_z = 256 beta = 1e-3 batch_size = 100 sa...
github_jupyter
## 1-2. 量子ビットに対する基本演算 量子ビットについて理解が深まったところで、次に量子ビットに対する演算がどのように表されるかについて見ていこう。 これには、量子力学の性質が深く関わっている。 1. 線型性: 詳しくは第4章で学ぶのだが、量子力学では状態(量子ビット)の時間変化はつねに(状態の重ね合わせに対して)線型になっている。つまり、**量子コンピュータ上で許された操作は状態ベクトルに対する線型変換**ということになる 。1つの量子ビットの量子状態は規格化された2次元複素ベクトルとして表現されるのだったから、 1つの量子ビットに対する操作=線型演算は$2 \times 2$の**複素行列**によって表現される。...
github_jupyter
``` %matplotlib inline from __future__ import absolute_import from __future__ import print_function import matplotlib.pyplot as plt import numpy as np np.random.seed(1337) # for reproducibility from theano import function from keras.datasets import mnist from keras.models import Sequential from keras.layers.core imp...
github_jupyter
``` import os import numpy as np import pandas as pd import jinja2 as jj def mklbl(prefix, n): return ["%s%s" % (prefix, i) for i in range(n)] miindex = pd.MultiIndex.from_product([mklbl('A', 4), mklbl('B', 2), mklbl('C', 4), ...
github_jupyter
# Figure 3: Cluster-level consumptions This notebook generates individual panels of Figure 3 in "Combining satellite imagery and machine learning to predict poverty". ``` from fig_utils import * import matplotlib.pyplot as plt import time %matplotlib inline ``` ## Predicting consumption expeditures The parameters ...
github_jupyter
<div align="center"> <h1><strong>Herencia</strong></h1> <strong>Hecho por:</strong> Juan David Argüello Plata </div> ## __Introducción__ <div align="justify"> La relación de herencia facilita la reutilización de código brindando una base de programación para el desarrollo de nuevas clases. </div> ## __1. Sup...
github_jupyter
# 0.0 Notebook Template --*Set the notebook number, describe the background of the project, the nature of the data, and what analyses will be performed.*-- ## Jupyter Extensions Load [watermark](https://github.com/rasbt/watermark) to see the state of the machine and environment that's running the notebook. To make s...
github_jupyter
``` # import lib # =========================================================== import csv import pandas as pd from datascience import * import numpy as np import random import time import matplotlib.pyplot as plt %matplotlib inline plt.style.use('fivethirtyeight') import collections import math import sys from tqdm imp...
github_jupyter
<center><h1>Improved Graph Laplacian via Geometric Self-Consistency</h1></center> <center>Yu-Chia Chen, Dominique Perrault-Joncas, Marina Meilă, James McQueen. University of Washington</center> <br> <center>Original paper: <a href=https://nips.cc/Conferences/2017/Schedule?showEvent=9223>Improved Graph Laplacian via Ge...
github_jupyter
##### Copyright 2019 Google LLC ``` #@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
github_jupyter
# Road Following - Live demo In this notebook, we will use model we trained to move jetBot smoothly on track. ### Load Trained Model We will assume that you have already downloaded ``best_steering_model_xy.pth`` to work station as instructed in "train_model.ipynb" notebook. Now, you should upload model file to JetBo...
github_jupyter
<h1 align='center' style="margin-bottom: 0px"> An end to end implementation of a Machine Learning pipeline </h1> <h4 align='center' style="margin-top: 0px"> SPANDAN MADAN</h4> <h4 align='center' style="margin-top: 0px"> Visual Computing Group, Harvard University</h4> <h4 align='center' style="margin-top: 0px"> Computer...
github_jupyter
# 광학 인식 ![신문을 읽고 있는 로봇](./images/ocr.jpg) 흔히 볼 수 있는 Computer Vision 과제는 이미지에서 텍스트를 감지하고 해석하는 것입니다. 이러한 종류의 처리를 종종 *OCR(광학 인식)*이라고 합니다. ## Computer Vision 서비스를 사용하여 이미지에서 텍스트 읽기 **Computer Vision** Cognitive Service는 다음을 비롯한 OCR 작업을 지원합니다. - 여러 언어로 된 텍스트를 읽는 데 사용할 수 있는 **OCR** API. 이 API는 동기식으로 사용할 수 있으며,...
github_jupyter
# The Atoms of Computation Programming a quantum computer is now something that anyone can do in the comfort of their own home. But what to create? What is a quantum program anyway? In fact, what is a quantum computer? These questions can be answered by making comparisons to standard digital computers. Unfortuna...
github_jupyter
!wget https://www.dropbox.com/s/ic9ym6ckxq2lo6v/Dataset_Signature_Final.zip #!wget https://www.dropbox.com/s/0n2gxitm2tzxr1n/lightCNN_51_checkpoint.pth #!wget https://www.dropbox.com/s/9yd1yik7u7u3mse/light_cnn.py import zipfile sigtrain = zipfile.ZipFile('Dataset_Signature_Final.zip', mode='r') sigtrain.extractall() ...
github_jupyter
# Miscellaneous This section describes the organization of classes, methods, and functions in the ``finite_algebra`` module, by way of describing the algebraic entities they represent. So, if we let $A \rightarrow B$ denote "A is a superclass of B", then the class hierarchy of algebraic structures in ``finite_algebra...
github_jupyter