text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
# SiteAlign features We read the SiteAlign features from the respective [paper](https://onlinelibrary.wiley.com/doi/full/10.1002/prot.21858) and [SI table](https://onlinelibrary.wiley.com/action/downloadSupplement?doi=10.1002%2Fprot.21858&file=prot21858-SupplementaryTable.pdf) to verify `kissim`'s implementation of th...
github_jupyter
``` #@markdown ■■■■■■■■■■■■■■■■■■ #@markdown 初始化openpose #@markdown ■■■■■■■■■■■■■■■■■■ #设置版本为1.x %tensorflow_version 1.x import tensorflow as tf tf.__version__ ! nvcc --version ! nvidia-smi ! pip install PyQt5 import time init_start_time = time.time() #安装 cmake #https://drive.google.com/file/d/1lAXs5X7qMnKQE4...
github_jupyter
``` ## Advanced Course in Machine Learning ## Week 4 ## Exercise 2 / Probabilistic PCA import numpy as np import scipy import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import matplotlib.animation as animation from numpy import linalg as LA sns.set_style("darkgrid") def build_dataset(N, D, K, ...
github_jupyter
``` %matplotlib inline import pandas as pd import cv2 import numpy as np from matplotlib import pyplot as plt df = pd.read_csv("data/22800_SELECT_t___FROM_data_data_t.csv",header=None,index_col=0) df = df.rename(columns={0:"no", 1: "CAPTDATA", 2: "CAPTIMAGE",3: "timestamp"}) df.info() df.sample(5) def alpha_to_gray(im...
github_jupyter
``` # Import and create a new SQLContext from pyspark.sql import SQLContext sqlContext = SQLContext(sc) # Read the country CSV file into an RDD. country_lines = sc.textFile('file:///home/ubuntu/work/notebooks/UCSD/big-data-3/final-project/country-list.csv') country_lines.collect() # Convert each line into a pair of wo...
github_jupyter
# Datafaucet Datafaucet is a productivity framework for ETL, ML application. Simplifying some of the common activities which are typical in Data pipeline such as project scaffolding, data ingesting, start schema generation, forecasting etc. ``` import datafaucet as dfc ``` ## Loading and Saving Data ``` dfc.project...
github_jupyter
![](https://memesbams.com/wp-content/uploads/2017/11/sheldon-sarcasm-meme.jpg) https://www.kaggle.com/danofer/sarcasm <div class="markdown-converter__text--rendered"><h3>Context</h3> <p>This dataset contains 1.3 million Sarcastic comments from the Internet commentary website Reddit. The dataset was generated by scrap...
github_jupyter
``` # Copyright 2020 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
# 3. Markov Models Example Problems We will now look at a model that examines our state of healthiness vs. being sick. Keep in mind that this is very much like something you could do in real life. If you wanted to model a certain situation or environment, we could take some data that we have gathered, build a maximum l...
github_jupyter
# Quantization of Signals *This jupyter notebook is part of a [collection of notebooks](../index.ipynb) on various topics of Digital Signal Processing. Please direct questions and suggestions to [Sascha.Spors@uni-rostock.de](mailto:Sascha.Spors@uni-rostock.de).* ## Spectral Shaping of the Quantization Noise The quan...
github_jupyter
# ------------ First A.I. activity ------------ ## 1. IBOVESPA volume prediction -> Importing libraries that are going to be used in the code ``` import pandas as pd import numpy as np import matplotlib.pyplot as plt ``` -> Importing the datasets ``` dataset = pd.read_csv("datasets/ibovespa.csv",delimiter = ";") `...
github_jupyter
# Plotting massive data sets This notebook plots about half a million LIDAR points around Toronto from the KITTI data set. ([Source](http://www.cvlibs.net/datasets/kitti/raw_data.php)) The data is meant to be played over time. With pydeck, we can render these points and interact with them. ### Cleaning the data Firs...
github_jupyter
# Seq2Seq with Attention for Korean-English Neural Machine Translation - Network architecture based on this [paper](https://arxiv.org/abs/1409.0473) - Fit to run on Google Colaboratory ``` import os import io import tarfile import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F...
github_jupyter
``` import os import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline STATS_DIR = "/hg191/corpora/legaldata/data/stats/" SEM_FEATS_FILE = os.path.join (STATS_DIR, "ops.temp.semfeat") INDEG_FILE = os.path.join (STATS_DIR, "ops.ind") ind = pd.read_csv (INDEG_FILE, ...
github_jupyter
``` #hide #skip ! [ -e /content ] && pip install -Uqq fastai # upgrade fastai on colab # default_exp losses # default_cls_lvl 3 #export from fastai.imports import * from fastai.torch_imports import * from fastai.torch_core import * from fastai.layers import * #hide from nbdev.showdoc import * ``` # Loss Functions > C...
github_jupyter
``` # HIDDEN from datascience import * %matplotlib inline import matplotlib.pyplot as plots plots.style.use('fivethirtyeight') import math import numpy as np from scipy import stats import ipywidgets as widgets import nbinteract as nbi ``` ### The Central Limit Theorem ### Very few of the data histograms that we have ...
github_jupyter
# Spark on Kubernetes Preparing the notebook https://towardsdatascience.com/make-kubeflow-into-your-own-data-science-workspace-cc8162969e29 ## Setup service account permissions https://github.com/kubeflow/kubeflow/issues/4306 issue with launching spark-operator from jupyter notebook Run command in your shell (not i...
github_jupyter
``` from Maze import Maze from sarsa_agent import SarsaAgent import numpy as np import matplotlib.pyplot as plt from matplotlib import animation from IPython.display import HTML ``` ## Designing the maze ``` arr=np.array([[0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0], [0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,...
github_jupyter
<a href="https://colab.research.google.com/github/NeuromatchAcademy/course-content/blob/master/tutorials/W1D2_ModelingPractice/student/W1D2_Tutorial2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Neuromatch Academy: Week1, Day 2, Tutorial 2 #Tu...
github_jupyter
_Lambda School Data Science_ # Make explanatory visualizations Tody we will reproduce this [example by FiveThirtyEight:](https://fivethirtyeight.com/features/al-gores-new-movie-exposes-the-big-flaw-in-online-movie-ratings/) ``` from IPython.display import display, Image url = 'https://fivethirtyeight.com/wp-cont...
github_jupyter
... ***CURRENTLY UNDER DEVELOPMENT*** ... ## Obtain synthetic waves and water level timeseries under a climate change scenario (future AWTs occurrence probability) inputs required: * Historical DWTs (for plotting) * Historical wave families (for plotting) * Synthetic DWTs climate change * Historical intrada...
github_jupyter
# Cyclical Systems: An Example of the Crank-Nicolson Method ## CH EN 2450 - Numerical Methods **Prof. Tony Saad (<a>www.tsaad.net</a>) <br/>Department of Chemical Engineering <br/>University of Utah** <hr/> ``` import numpy as np from numpy import * # %matplotlib notebook # %matplotlib nbagg %matplotlib inline %config...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_parent" href="https://github.com/giswqs/geemap/tree/master/tutorials/Image/06_convolutions.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target="_parent" href="https:...
github_jupyter
<h1 align="center">Theano</h1> ``` !pip install numpy matplotlib !pip install --upgrade https://github.com/Theano/Theano/archive/master.zip !pip install --upgrade https://github.com/Lasagne/Lasagne/archive/master.zip ``` ### Разминка ``` import theano import theano.tensor as T %pylab inline ``` #### будущий пар...
github_jupyter
查看当前GPU信息 ``` from tensorflow.python.client import device_lib device_lib.list_local_devices() !pip install bert-tensorflow import pandas as pd import tensorflow as tf import tensorflow_hub as hub import pickle import bert from bert import run_classifier from bert import optimization from bert import tokenization def ...
github_jupyter
## Change sys.path to use my tensortrade instead of the one in env ``` import sys sys.path.append("/Users/jasonfiacco/Documents/Yale/Senior/thesis/deeptrader") print(sys.path) ``` ## Read PredictIt Data Instead ``` import ssl import pandas as pd ssl._create_default_https_context = ssl._create_unverified_context # O...
github_jupyter
[Table of Contents](./table_of_contents.ipynb) # Smoothing ``` #format the book %matplotlib inline from __future__ import division, print_function from book_format import load_style load_style() ``` ## Introduction The performance of the Kalman filter is not optimal when you consider future data. For example, suppo...
github_jupyter
# 準備 ``` # バージョン指定時にコメントアウト #!pip install torch==1.7.0 #!pip install torchvision==0.8.1 import torch import torchvision # バージョンの確認 print(torch.__version__) print(torchvision.__version__) # Google ドライブにマウント from google.colab import drive drive.mount('/content/gdrive') %cd '/content/gdrive/MyDrive/Colab Notebooks/gan_...
github_jupyter
# One-step error probability Write a computer program implementing asynchronous deterministic updates for a Hopfield network. Use Hebb's rule with $w_{ii}=0$. Generate and store p=[12,24,48,70,100,120] random patterns with N=120 bits. Each bit is either +1 or -1 with probability $\tfrac{1}{2}$. For each value of ppp...
github_jupyter
# Acquiring Data from open repositories A crucial step in the work of a computational biologist is not only to analyse data, but acquiring datasets to analyse as well as toy datasets to test out computational methods and algorithms. The internet is full of such open datasets. Sometimes you have to sign up and make a u...
github_jupyter
# Code Review #1 Purpose: To introduce the group to looking at code analytically Created By: Hawley Helmbrecht Creation Date: 10-12-21 # Introduction to Analyzing Code All snipets within this section are taken from the Hitchhiker's Guide to Python (https://docs.python-guide.org/writing/style/) ### Example 1: Exp...
github_jupyter
**Recursion and Higher Order Functions** Today we're tackling recursion, and touching on higher-order functions in Python. A **recursive** function is one that calls itself. A classic example: the Fibonacci sequence. The Fibonacci sequence was originally described to model population growth, and is self-refer...
github_jupyter
# Introduction to `pandas` ``` import numpy as np import pandas as pd ``` ## Series and Data Frames ### Series objects A `Series` is like a vector. All elements must have the same type or are nulls. ``` s = pd.Series([1,1,2,3] + [None]) s ``` ### Size ``` s.size ``` ### Unique Counts ``` s.value_counts() ``` ...
github_jupyter
# SLU13: Bias-Variance trade-off & Model Selection -- Examples --- <a id='top'></a> ### 1. Model evaluation * a. [Train-test split](#traintest) * b. [Train-val-test split](#val) * c. [Cross validation](#crossval) ### 2. [Learning curves](#learningcurves) # 1. Model evaluation ``` import matplotlib.pyplot as plt ...
github_jupyter
# Phi_K advanced tutorial This notebook guides you through the more advanced functionality of the phik package. This notebook will not cover all the underlying theory, but will just attempt to give an overview of all the options that are available. For a theoretical description the user is referred to our paper. The ...
github_jupyter
``` import tabula import numpy as np import pandas as pd import os from pathlib import Path import PyPDF2 import re import requests import json import time # filenames = [ # os.path.expanduser('/home/parth/Documents/USICT/it_res.pdf'), # os.path.expanduser('/home/parth/Documents/USICT/cse_res...
github_jupyter
# Description This notebook runs some pre-analyses using DBSCAN to explore the best set of parameters (`min_samples` and `eps`) to cluster `pca` data version. # Environment variables ``` from IPython.display import display import conf N_JOBS = conf.GENERAL["N_JOBS"] display(N_JOBS) %env MKL_NUM_THREADS=$N_JOBS %en...
github_jupyter
## Rhetorical relations classification used in tree building: ESIM Prepare data and model-related scripts. Evaluate models. Make and evaluate ansembles for ESIM and BiMPM model / ESIM and feature-based model. Output: - ``models/relation_predictor_esim/*`` ``` %load_ext autoreload %autoreload 2 import os import gl...
github_jupyter
<a href="https://colab.research.google.com/github/ebagdasa/propaganda_as_a_service/blob/master/Spinning_Language_Models_for_Propaganda_As_A_Service.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Experimenting with spinned models This is a Colab ...
github_jupyter
``` import matplotlib.pyplot as plt import numpy as np from mpl_toolkits.mplot3d import Axes3D import scipy as sp import sympy as sy sy.init_printing() np.set_printoptions(precision=3) np.set_printoptions(suppress=True) from IPython.core.interactiveshell import InteractiveShell InteractiveShell.ast_node_interactivity =...
github_jupyter
# Neural Network **Learning Objectives:** * Use the `DNNRegressor` class in TensorFlow to predict median housing price The data is based on 1990 census data from California. This data is at the city block level, so these features reflect the total number of rooms in that block, or the total number of people who liv...
github_jupyter
# Exploring Neural Audio Synthesis with NSynth ## Parag Mital There is a lot to explore with NSynth. This notebook explores just a taste of what's possible including how to encode and decode, timestretch, and interpolate sounds. Also check out the [blog post](https://magenta.tensorflow.org/nsynth-fastgen) for more ...
github_jupyter
## A Two-sample t-test to find differentially expressed miRNA's between normal and tumor tissues in Lung Adenocarcinoma ``` import os import pandas mirna_src_dir = os.getcwd() + "/assn-mirna-luad/data/processed/miRNA/" clinical_src_dir = os.getcwd() + "/assn-mirna-luad/data/processed/clinical/" mirna_tumor_df = pand...
github_jupyter
# Step 7: Serve data from OpenAgua into WEAP using WaMDaM #### By Adel M. Abdallah, Dec 2020 Execute the following cells by pressing `Shift-Enter`, or by pressing the play button <img style='display:inline;padding-bottom:15px' src='play-button.png'> on the toolbar above. ## Steps 1. Import python libraries 2. Impor...
github_jupyter
# Optimizing building HVAC with Amazon SageMaker RL ``` import sagemaker import boto3 from sagemaker.rl import RLEstimator from source.common.docker_utils import build_and_push_docker_image ``` ## Initialize Amazon SageMaker ``` role = sagemaker.get_execution_role() sm_session = sagemaker.session.Session() # Sage...
github_jupyter
# Spleen 3D segmentation with MONAI This tutorial demonstrates how MONAI can be used in conjunction with the [PyTorch Lightning](https://github.com/PyTorchLightning/pytorch-lightning) framework. We demonstrate use of the following MONAI features: 1. Transforms for dictionary format data. 2. Loading Nifti images with ...
github_jupyter
``` import numpy as np import pandas as pd from matplotlib import pyplot as plt from tqdm import tqdm as tqdm %matplotlib inline import torch import torchvision import torchvision.transforms as transforms import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import random # from google.co...
github_jupyter
# Binary classification from 2 features using K Nearest Neighbors (KNN) Classification using "raw" python or libraries. The binary classification is on a single boundary defined by a continuous function and added white noise ``` import numpy as np from numpy import random import matplotlib.pyplot as plt import matpl...
github_jupyter
<a href="https://colab.research.google.com/github/harnalashok/hadoop/blob/main/hadoop_spark_install_on_Colab.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` # Last amended: 30th March, 2021 # Myfolder: github/hadoop # Objective: # i) ...
github_jupyter
# Comprehensive Example ``` # Enabling the `widget` backend. # This requires jupyter-matplotlib a.k.a. ipympl. # ipympl can be install via pip or conda. %matplotlib widget import matplotlib.pyplot as plt import numpy as np # Testing matplotlib interactions with a simple plot fig = plt.figure() plt.plot(np.sin(np.lins...
github_jupyter
# Interactive single compartment HH example To run this interactive Jupyter Notebook, please click on the rocket icon 🚀 in the top panel. For more information, please see {ref}`how to use this documentation <userdocs:usage:jupyterbooks>`. Please uncomment the line below if you use the Google Colab. (It does not inclu...
github_jupyter
## Amazon SageMaker Feature Store: Encrypt Data in your Online or Offline Feature Store using KMS key This notebook demonstrates how to enable encyption for your data in your online or offline Feature Store using KMS key. We start by showing how to programmatically create a KMS key, and how to apply it to the feature ...
github_jupyter
# Hyperparameter tuning In the previous section, we did not discuss the parameters of random forest and gradient-boosting. However, there are a couple of things to keep in mind when setting these. This notebook gives crucial information regarding how to set the hyperparameters of both random forest and gradient boost...
github_jupyter
``` # !pip install ray[tune] import pandas as pd import numpy as np from matplotlib import pyplot as plt from sklearn.metrics import mean_squared_error from hyperopt import hp from ray import tune from hyperopt import fmin, tpe, hp,Trials, space_eval import scipy.stats df = pd.read_csv("../../Data/Raw/flightLogData.csv...
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
# Selected Economic Characteristics: Employment Status from the American Community Survey **[Work in progress]** This notebook downloads [selected economic characteristics (DP03)](https://data.census.gov/cedsci/table?tid=ACSDP5Y2018.DP03) from the American Community Survey 2018 5-Year Data. Data source: [American Co...
github_jupyter
## Dimensionality Reduction ``` from sklearn.decomposition import PCA ``` ### Principal Components Analysis ``` o_dir = os.path.join('outputs','pca') if os.path.isdir(o_dir) is not True: print("Creating '{0}' directory.".format(o_dir)) os.mkdir(o_dir) pca = PCA() # Use all Princ...
github_jupyter
# Flopy MODFLOW 6 (MF6) Support The Flopy library contains classes for creating, saving, running, loading, and modifying MF6 simulations. The MF6 portion of the flopy library is located in: *flopy.mf6* While there are a number of classes in flopy.mf6, to get started you only need to use the main classes summarized ...
github_jupyter
<a href="https://colab.research.google.com/github/Tessellate-Imaging/monk_v1/blob/master/study_roadmaps/3_image_processing_deep_learning_roadmap/3_deep_learning_advanced/1_Blocks%20in%20Deep%20Learning%20Networks/8)%20Resnet%20V2%20Bottleneck%20Block%20(Type%20-%202).ipynb" target="_parent"><img src="https://colab.rese...
github_jupyter
``` import pandas as pd import geopandas as gpd import matplotlib.pyplot as plt import numpy as np from pyproj import CRS import pathlib from pathlib import Path from shapely import wkt from tqdm import tqdm import math import codecs from shapely import wkt import folium from folium import features from folium impor...
github_jupyter
# Experiments comparing the performance of traditional pooling operations and entropy pooling within a shallow neural network and Lenet. The experiments use cifar10 and cifar100. ``` %matplotlib inline import torch import torchvision import torchvision.transforms as transforms transform = transforms.Compose( [tran...
github_jupyter
<a href="https://colab.research.google.com/github/AIWintermuteAI/aXeleRate/blob/dev/resources/aXeleRate_mark_detector.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ## M.A.R.K. Detection model Training and Inference In this notebook we will use ax...
github_jupyter
# Docutils ## Presentation Click [__here__] (youtube link) for the video presentation ## Summary of Support Files - `demo.ipynb`: the notebook containing this tutorial code - `test.csv`: a small file data used in the tutorial code ## Installation Instructions Use `!pip install docutils` to install the `docutils` ...
github_jupyter
## Statistics ### Questions ```{admonition} Problem: JOIN Dataframes :class: dropdown, tip Can you tell me the ways in which 2 pandas data frames can be joined? ``` ```{admonition} Solution: :class: dropdown A very high level difference is that merge() is used to combine two (or more) dataframes on the basis of valu...
github_jupyter
# Real Estate Price Prediction ``` import pandas as pd df = pd.read_csv("data.csv") df.head() df['CHAS'].value_counts() df.info() df.describe() %matplotlib inline import matplotlib.pyplot as plt df.hist(bins=50, figsize=(20,15)) ``` ## train_test_split ``` import numpy as np def split_train_test(data, test_ratio): ...
github_jupyter
# In-Place Waveform Library Updates This example notebook shows how one can update pulses data in-place without recompiling. © Raytheon BBN Technologies 2020 Set the `SAVE_WF_OFFSETS` flag in order that QGL will output a map of the waveform data within the compiled binary waveform library. ``` from QGL import * impo...
github_jupyter
``` %matplotlib inline from IPython.core.display import display, HTML display(HTML("<style>.container { width:100% !important; }</style>")) import numpy as np np.set_printoptions(precision=3, suppress=True) import library.helpers as h import matplotlib.pyplot as plt import numpy as np from sklearn.metrics import auc fr...
github_jupyter
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ourownstory/neural_prophet/blob/master/example_notebooks/sub_daily_data_yosemite_temps.ipynb) # Sub-daily data NeuralProphet can make forecasts for time series with sub-daily observations by passing in...
github_jupyter
<center> <img src="https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-PY0101EN-SkillsNetwork/IDSNlogo.png" width="300" alt="cognitiveclass.ai logo" /> </center> # Classes and Objects in Python Estimated time needed: **40** minutes ## Objectives After completing this la...
github_jupyter
# LOFO Feature Importance https://github.com/aerdem4/lofo-importance ``` !pip install lofo-importance import numpy as np import pandas as pd df = pd.read_csv("../input/train.csv", index_col='id') df['wheezy-copper-turtle-magic'] = df['wheezy-copper-turtle-magic'].astype('category') df.shape ``` ### Use the best mode...
github_jupyter
# End-to-end learning for music audio - http://qiita.com/himono/items/a94969e35fa8d71f876c ``` # データのダウンロード wget http://mi.soi.city.ac.uk/datasets/magnatagatune/mp3.zip.001 wget http://mi.soi.city.ac.uk/datasets/magnatagatune/mp3.zip.002 wget http://mi.soi.city.ac.uk/datasets/magnatagatune/mp3.zip.003 # 結合 cat data/...
github_jupyter
<table> <tr> <td style="background-color:#ffffff;"> <a href="http://qworld.lu.lv" target="_blank"><img src="..\images\qworld.jpg" width="25%" align="left"> </a></td> <td style="background-color:#ffffff;vertical-align:bottom;text-align:right;"> prepared by <a href="http://abu.lu....
github_jupyter
``` import os import pickle from neutrinomass.completions import EffectiveOperator, Completion from neutrinomass.database import ExoticField from neutrinomass.database import ModelDataFrame, EXOTICS, TERMS, MVDF from neutrinomass.completions import EFF_OPERATORS from neutrinomass.completions import DERIV_EFF_OPERATORS...
github_jupyter
``` from IPython.display import HTML # Cell visibility - COMPLETE: #tag = HTML('''<style> #div.input { # display:none; #} #</style>''') #display(tag) #Cell visibility - TOGGLE: tag = HTML('''<script> code_show=true; function code_toggle() { if (code_show){ $('div.input').hide() } else { $(...
github_jupyter
Mount my google drive, where I stored the dataset. ``` from google.colab import drive drive.mount('/content/drive') ``` **Download dependencies** ``` !pip3 install sklearn matplotlib GPUtil !pip3 install torch torchvision ``` **Download Data** In order to acquire the dataset please navigate to: https://ieee-datap...
github_jupyter
``` %matplotlib inline ``` # Simple Oscillator Example This example shows the most simple way of using a solver. We solve free vibration of a simple oscillator: $$m \ddot{u} + k u = 0,\quad u(0) = u_0,\quad \dot{u}(0) = \dot{u}_0$$ using the CVODE solver. An analytical solution exists, given by $$u(t) = u_0 \cos\left...
github_jupyter
``` import classifierMLP as cmlp import os import struct import numpy as np def load_mnist(path, kind='train'): """Load MNIST data from `path`""" labels_path = os.path.join(path, '%s-labels-idx1-ubyte' % kind) images_path = os.path.join(path, ...
github_jupyter
# Siamese networks with TensorFlow 2.0/Keras In this example, we'll implement a simple siamese network system, which verifyies whether a pair of MNIST images is of the same class (true) or not (false). _This example is partially based on_ [https://github.com/keras-team/keras/blob/master/examples/mnist_siamese.py](ht...
github_jupyter
# BBoxerwGradCAM ### This class forms boundary boxes (rectangle and polygon) using GradCAM outputs for a given image. The purpose of this class is to develop Rectangle and Polygon coordinates that define an object based on an image classification model. The 'automatic' creation of these coordinates, which are often i...
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
# Object Detection with SSD ### Here we demostrate detection on example images using SSD with PyTorch ``` import os import sys module_path = os.path.abspath(os.path.join('..')) if module_path not in sys.path: sys.path.append(module_path) import torch import torch.nn as nn import torch.backends.cudnn as cudnn from...
github_jupyter
# Data Attribute Recommendation - TechED 2020 INT260 Getting started with the Python SDK for the Data Attribute Recommendation service. ## Business Scenario We will consider a business scenario involving product master data. The creation and maintenance of this product master data requires the careful manual selecti...
github_jupyter
# Resumen Este cuaderno digital interactivo tiene como objetivo demostrar las relaciones entre las propiedades fisico-químicas de la vegetación y el espectro solar. Para ello haremos uso de modelos de simulación, en particular de modelos de transferencia radiativa tanto a nivel de hoja individual como a nivel de dosel...
github_jupyter
``` ls -l| tail -10 #G4 from google.colab import drive drive.mount('/content/gdrive') cp gdrive/My\ Drive/fingerspelling5.tar.bz2 fingerspelling5.tar.bz2 # rm -r surrey/ %rm -r dataset5/ # rm fingerspelling5.tar.bz2 # cd /media/datastorage/Phong/ !tar xjf fingerspelling5.tar.bz2 cd dataset5 mkdir surrey mkdir surrey/D ...
github_jupyter
## Dependencies ``` # !pip install --quiet efficientnet !pip install --quiet image-classifiers import warnings, json, re, glob, math from scripts_step_lr_schedulers import * from melanoma_utility_scripts import * from kaggle_datasets import KaggleDatasets from sklearn.model_selection import KFold import tensorflow.ker...
github_jupyter
``` import pandas as pd import matplotlib.pyplot as plt import folium from folium.plugins import MarkerCluster %matplotlib inline australia=pd.read_csv("https://frenzy86.s3.eu-west-2.amazonaws.com/fav/australia_cleaned.csv") australia.head() plt.figure(figsize=(18,12)) plt.hist(australia["confidence"],label="Sicurezz...
github_jupyter
``` import numpy as np import tensorflow.compat.v1 as tf tf.disable_v2_behavior() import tensorflow_probability as tfp # -- plotting import matplotlib as mpl import matplotlib.pyplot as plt mpl.rcParams['text.usetex'] = True mpl.rcParams['font.family'] = 'serif' mpl.rcParams['axes.linewidth'] = 1.5 mpl.rcParams['ax...
github_jupyter
``` import keras from keras.models import Sequential, Model, load_model from keras.layers import Dense, Dropout, Activation, Flatten, Input, Lambda from keras.layers import Conv2D, MaxPooling2D, Conv1D, MaxPooling1D, LSTM, ConvLSTM2D, GRU, BatchNormalization, LocallyConnected2D, Permute from keras.layers import Concat...
github_jupyter
# 工厂规划 等级:中级 ## 目的和先决条件 此模型和Factory Planning II都是生产计划问题的示例。在生产计划问题中,必须选择要生产哪些产品,要生产多少产品以及要使用哪些资源,以在满足一系列限制的同时最大化利润或最小化成本。这些问题在广泛的制造环境中都很常见。 ### What You Will Learn 在此特定示例中,我们将建模并解决生产组合问题:在每个阶段中,我们可以制造一系列产品。每种产品在不同的机器上生产需要不同的时间,并产生不同的利润。目的是创建最佳的多周期生产计划,以使利润最大化。由于维护,某些机器在特定时期内不可用。由于市场限制,每个产品每个月的销售量都有上限,并且存储容量也受到限制。...
github_jupyter
``` import pandas as pd import matplotlib.pyplot as plt import datetime as dt import seaborn as sns import numpy as np import matplotlib.dates as mdates import datetime #sns.set(color_codes=True) import matplotlib as mpl mpl.rcParams['pdf.fonttype'] = 42 import statistics as st sns.set_style('whitegrid', {'axes.linewid...
github_jupyter
<a href="https://colab.research.google.com/github/MattFinney/practical_data_science_in_python/blob/main/Session_2_Practical_Data_Science.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/><a> # Practical Data Science in Python ## Unsupervised Learning: Clas...
github_jupyter
# Python是什么? ### Python是一种高级的多用途编程语言,广泛用于各种非技术和技术领域。Python是一种具备动态语义、面向对象的解释型高级编程语言。它的高级内建数据结构和动态类型及动态绑定相结合,使其在快速应用开发上极具吸引力,也适合于作为脚本或者“粘合剂”语言,将现有组件连接起来。Python简单、易学的语法强调可读性,因此可以降低程序维护成本。Python支持模块和软件包,鼓励模块化的代码重用。 ``` print('hellow world') ``` ## Python简史 ### 1989,为了度过圣诞假期,Guido开始编写Python语言编译器。Python这个名字来自Guido的喜爱的电视连...
github_jupyter
<a href="https://colab.research.google.com/github/huan/concise-chit-chat/blob/master/Concise_Chit_Chat.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Concise Chit Chat GitHub Repository: <https://github.com/huan/concise-chit-chat> ## Code TODO:...
github_jupyter
<img src="../../../../images/qiskit-heading.gif" alt="Note: In order for images to show up in this jupyter notebook you need to select File => Trusted Notebook" width="500 px" align="left"> # _*Quantum K-Means algorithm*_ The latest version of this notebook is available on https://github.com/qiskit/qiskit-tutorial....
github_jupyter
# Trigger Examples Triggers allow the user to specify a set of actions that are triggered by the result of a boolean expression. They provide flexibility to adapt what analysis and visualization actions are taken in situ. Triggers leverage Ascent's Query and Expression infrastructure. See Ascent's [Triggers](https://as...
github_jupyter
## These notebooks can be found at https://github.com/jaspajjr/pydata-visualisation if you want to follow along https://matplotlib.org/users/intro.html Matplotlib is a library for making 2D plots of arrays in Python. * Has it's origins in emulating MATLAB, it can also be used in a Pythonic, object oriented way. ...
github_jupyter
# Procedures and Functions Tutorial MLDB is the Machine Learning Database, and all machine learning operations are done via Procedures and Functions. Training a model happens via Procedures, and applying a model happens via Functions. The notebook cells below use `pymldb`'s `Connection` class to make [REST API](../.....
github_jupyter
### Analysis of motifs using Motif Miner (RINGS tool that employs alpha frequent subtree mining) ``` csv_files = ["ABA_14361_100ug_v5.0_DATA.csv", "ConA_13799-10ug_V5.0_DATA.csv", 'PNA_14030_10ug_v5.0_DATA.csv', "RCAI_10ug_14110_v5.0_DATA.csv", "PHA-E-10ug_13853_V5.0...
github_jupyter
``` import json import random import numpy as np import tensorflow as tf from collections import deque from keras.models import Sequential from keras.optimizers import RMSprop from keras.layers import Dense, Flatten from keras.layers.convolutional import Conv2D from keras import backend as K import datetime import iter...
github_jupyter
<a href="https://colab.research.google.com/github/dauparas/tensorflow_examples/blob/master/VAE_cell_cycle.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> https://github.com/PMBio/scLVM/blob/master/tutorials/tcell_demo.ipynb Variational Autoencoder ...
github_jupyter