text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
``` %matplotlib notebook import matplotlib.pyplot as plt import pandas as pd import numpy as np import scipy.optimize ``` # Diagnóstico de cancer usando un regresor logístico Considere el dataset de [diagnóstico de cancer de mama de la Universidad de Wisconsin](https://archive.ics.uci.edu/ml/datasets/Breast+Cancer+Wi...
github_jupyter
``` from __future__ import print_function import sys import numpy as np from time import time import matplotlib.pyplot as plt from tqdm import tqdm import math import struct import binascii sys.path.append('/home/xilinx') from pynq import Overlay from pynq import allocate SUDOKU_BLOCK_LEN = 3 SUDOKU_BOARD_LEN = SUDO...
github_jupyter
#An example machine learning notebook ###Notebook by [Randal S. Olson](http://www.randalolson.com/) ####Supported by [Jason H. Moore](http://www.epistasis.org/) ####[University of Pennsylvania Institute for Bioinformatics](http://upibi.org/) **It is recommended to [view this notebook in nbviewer](http://nbviewer.ipyt...
github_jupyter
# Hyperparameter tuning by randomized-search In the previous notebook, we showed how to use a grid-search approach to search for the best hyperparameters maximizing the generalization performance of a predictive model. However, a grid-search approach has limitations. It does not scale when the number of parameters to...
github_jupyter
``` import numpy as np import cv2 from keras.preprocessing.image import load_img, save_img, img_to_array from keras.models import load_model from os import listdir import matplotlib.pyplot as plt from keras.applications.imagenet_utils import preprocess_input faceCascade= cv2.CascadeClassifier('haarcascade_frontalface_d...
github_jupyter
# Introduction to Testing Testing is an easy thing to understand but there is also an art to it as well; writing good tests often requires you to try to figure out *what input(s) are most likely to break your program*. In addition to this, tests can serve different purposes as well: * Testing for correctness * Test...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns import scipy.io as sio import os import subprocess import bisect import errno import time import pandas import pickle import num2word from sklearn.decomposition import PCA from sklearn.svm import SVC, SVR from sklearn.metric...
github_jupyter
``` import tensorflow as tf from keras.backend.tensorflow_backend import set_session # config = tf.ConfigProto() # config.gpu_options.allocator_type = 'BFC' #A "Best-fit with coalescing" algorithm, simplified from a version of dlmalloc. # config.gpu_options.per_process_gpu_memory_fraction = 0.3 # config.gpu_options.all...
github_jupyter
``` from google.colab import drive drive.mount('/content/drive') ``` # Downloading the dependencies - Downloading the dataset from kaggle using the kaggle API - Downloading pretrained GloVe embeddings ``` from IPython.display import clear_output !pip install kaggle %env KAGGLE_USERNAME=xerefic %env KAGGLE_KEY=83aac...
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 ...
github_jupyter
# Run RERF C++ vs CySPORF Side By Side on CC-18 Dataset ``` %load_ext lab_black import sys import os from pathlib import Path import numpy as np import collections from tqdm import tqdm from pathlib import Path import time import logging import json from collections import defaultdict import pandas as pd import seab...
github_jupyter
# 用通用强化学习算法自我对弈,掌握国际象棋和将棋 [`程世东`](http://zhihu.com/people/cheng-shi-dong-47) 翻译 [`GitHub`](http://github.com/chengstone) [`Mail`](mailto:69558140@163.com) 国际象棋是人工智能史上研究最为广泛的领域。最强大的象棋程序是基于复杂的搜索技术、适应于特定领域、和过去几十年里人类专家手工提炼的评估函数的结合。相比之下,通过自我对弈进行“白板”强化学习,在围棋游戏中AlphaGo Zero取得了超越人类的成绩。在本文中,我们将这种方法推广到一个单一的AlphaZero算法中,从“白板”...
github_jupyter
### Maximal Clique   A clique is a subset of a graph that each vertex is interconnected. A maximal clique is a clique that has reached its maximum degree. No extra vertex can be added into the clique so that each vertex is interconnected. For details, you can check out this video. https://www.youtube.com/watch...
github_jupyter
Now we run this a second time, on the second (`b`) feature table that has removed all epithets with fewer than 27 representative documents. The results are better (overall F1 score for decision tree is `0.44`, random forest is `0.47`; in `a` these were `0.33` and `0.40`, respectively). ``` import os from sklearn impor...
github_jupyter
# Intrusion detection on NSL-KDD This is my try with [NSL-KDD](http://www.unb.ca/research/iscx/dataset/iscx-NSL-KDD-dataset.html) dataset, which is an improved version of well-known [KDD'99](http://kdd.ics.uci.edu/databases/kddcup99/kddcup99.html) dataset. I've used Python, Scikit-learn and PySpark via [ready-to-run J...
github_jupyter
### `pysgrid` only works with raw netCDF4 (for now!) ``` from netCDF4 import Dataset url = ('http://geoport.whoi.edu/thredds/dodsC/clay/usgs/users/' 'jcwarner/Sandy/triple_nest/00_dir_NYB07.ncml') #url = '00_dir_NYB05.nc' nc = Dataset(url) ``` ### The sgrid object ``` import pysgrid sgrid = pysgri...
github_jupyter
# Riemannian Optimisation with Pymanopt for Inference in MoG models The Mixture of Gaussians (MoG) model assumes that datapoints $\mathbf{x}_i\in\mathbb{R}^d$ follow a distribution described by the following probability density function: $p(\mathbf{x}) = \sum_{m=1}^M \pi_m p_\mathcal{N}(\mathbf{x};\mathbf{\mu}_m,\mat...
github_jupyter
## TL;DR Hey it's me hijacking **Shujian Liu**'s kernel again. Sorry for the clickbait (it works?), anyway this is what we did, and it's kind of embarassing: - Various tests done by the author showed that the models tend to overfit/cease to improve after a certain number of epochs. - Because of that, the whole purpo...
github_jupyter
# BLU03 - Learning Notebook - Part 2 of 3 - HTTP requests ## 1. Introduction In this notebook, you'll be introduced to the wonderful world of getting data from APIs (Application Programming Interfaces). And APIs really are a fantastic data source because they can usually give access to structured data, very fast. Bu...
github_jupyter
# Classy Models Before reading this, please go over the [Getting Started tutorial](https://classyvision.ai/tutorials/getting_started). Working with Classy Vision requires models to be instances of `ClassyModel`. A `ClassyModel` is an instance of `torch.nn.Module`, but packed with a lot of extra features! If your mo...
github_jupyter
# Keras tutorial - the Happy House Welcome to the first assignment of week 2. In this assignment, you will: 1. Learn to use Keras, a high-level neural networks API (programming framework), written in Python and capable of running on top of several lower-level frameworks including TensorFlow and CNTK. 2. See how you c...
github_jupyter
# Estimating Mandatory Tour Frequency This notebook illustrates how to re-estimate a single model component for ActivitySim. This process includes running ActivitySim in estimation mode to read household travel survey files and write out the estimation data bundles used in this notebook. To review how to do so, ple...
github_jupyter
# Drugs From One-Step Amide Formation ## Load modules ``` from rdkit import Chem from rdkit.Chem import AllChem from rdkit.Chem.Draw import IPythonConsole from rdkit.Chem import Draw from rdkit import rdBase from rdkit.Chem import PandasTools import pandas as pd import csv print('RDKit version: %s' % rdBase.rdkitVe...
github_jupyter
# Parsing a data2dome feed to find and acquire fulldome images This notebook shows how to connect to a [data2dome](https://docs.google.com/document/d/1USG1clnxSyGf9lsDe-alb6nZzxn_xFzxbjCnSVPzlWU/edit#) JSON feed. In this example we query the ESO images feed and search for recent images in fulldome format. We then con...
github_jupyter
# N-Body Problem and Symplectic Integrators > Author: Gil Miranda Neto<br> > Contact: gilsmneto@gmail.com<br> > Repo: [@mirandagil](https://github.com/mirandagil/university-courses/analise-numerica-edo-2019-1/project)<br> `last update: 30/05/2019` --- ``` import time import numpy as np from math import sqrt fr...
github_jupyter
# Text Processing Exercise In this exerise, you will learn some building blocks for text processing . You will learn how to normalize, tokenize, stemmeize, and lemmatize tweets from Twitter. ### Fetch Data from the online resource First, we will use the `get_tweets()` function from the `exercise_helper` module to g...
github_jupyter
## 2300 extensions Reads in data from historical, SSP 5-8.5 + SSP5-3.4OS & SSP extensions b.e21.BWSSP585extcmip6.f09_g17.CMIP6-SSP5-8.5ext-WACCM.001 b.e21.BWSSP534osextcmip6.f09_g17.CMIP6-SSP5-3.4OSext-WACCM.001 plots change in global TOTECOSYSC ``` import xarray as xr import cf_units as cf import numpy as np impor...
github_jupyter
# CME statistics cme_statistics.py https://github.com/cmoestl/heliocats analyses ICMECAT data for paper on CME statistics Author: C. Moestl, IWF Graz, Austria twitter @chrisoutofspace, https://github.com/cmoestl last update April 2020 For installation of a conda environment to run this code and how to download the ...
github_jupyter
``` import warnings warnings.filterwarnings('ignore') from datetime import datetime from PIL import Image, ImageFilter from pprint import pprint import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib inline from utils.dataloader import gen_dataloader_with_specified_train_val_data from util...
github_jupyter
# IDA - Customer Churn Prediction #### This dataset contains 7043 observations (i.e. customers) and 21 features that can be broken down into three categories: 1) Demographics 2) Account information 3) Payment information. #### Our target feature is the “Churn” column, which indicates whether a customer has...
github_jupyter
# Multi-GPU Training Example Train a convolutional neural network on multiple GPU with TensorFlow. This example is using TensorFlow layers, see 'convolutional_network_raw' example for a raw TensorFlow implementation with variables. ## Training with multiple GPU cards In this example, we are using data parallelism t...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt from EMAN2 import * #### select one GPU when multiple GPUs are present os.environ["CUDA_VISIBLE_DEVICES"]='0' #### do not occupy the entire GPU memory at once ## seems necessary to avoid some errors... os.environ["TF_FORCE_GPU_ALLOW_GROWTH"]='true' #### final...
github_jupyter
# 05__mpranalyze_compare_crossrep in this notebook, i run MPRAnalyze in 'compare' mode to get log2 foldchanges and p-values between (a) sequence orthologs and (b) cell types; this time *only* looking across replicates (rep1 in human/mouse for cis effects, rep2 in human/mouse for trans effects) ``` # # install MPRAnal...
github_jupyter
# Hyperparameter Tuning using SageMaker Tensorflow Container This tutorial focuses on how to create a convolutional neural network model to train the [MNIST dataset](http://yann.lecun.com/exdb/mnist/) using **SageMaker TensorFlow container**. It leverages hyperparameter tuning to kick off multiple training jobs with d...
github_jupyter
# Airplane Capital Budgeting Monte Carlo Problem # The Basic Model Before we get to the Monte Carlo part or bringing in any of the distributions, we just want to be able to get the base NPV for a plane. To get there, we will need to find the cash flows of the plane. We already have the research and manufacture costs ...
github_jupyter
# Coverage of MultiPLIER LV The goal of this notebook is to examine why genes were found to be generic. Specifically, this notebook is trying to answer the question: Are generic genes found in more multiplier latent variables compared to specific genes? The PLIER model performs a matrix factorization of gene expressi...
github_jupyter
``` import numpy as np import pandas as pd import seaborn as sns import nibabel as nib import bct from os import makedirs from matplotlib.colors import LinearSegmentedColormap from os.path import join, exists from nilearn.plotting import plot_glass_brain, plot_roi, find_parcellation_cut_coords #import bct import dateti...
github_jupyter
# Convolutional Neural Networks ## Project: Write an Algorithm for a Dog Identification App --- In this notebook, some template code has already been provided for you, and you will need to implement additional functionality to successfully complete this project. You will not need to modify the included code beyond ...
github_jupyter
# Nu-Support Vector Classification with RobustScaler This Code template is for the Classification task using Nu-Support Vector Classifier(NuSVC) based on the Support Vector Machine algorithm with RobustScaler as feature rescaling technique in a pipeline. ### Required Packages ``` !pip install imblearn import numpy ...
github_jupyter
# Dirichlet-Multinomial Distribution This notebook is about the [Dirichlet-Multinomial distribution](https://en.wikipedia.org/wiki/Dirichlet-multinomial_distribution). This distribution has a wide ranging array of applications to modelling categorical variables. It has found its way into machine learning areas such as...
github_jupyter
# pycaret machine learning # setup ``` import numpy as np import pandas as pd import matplotlib import matplotlib.pyplot as plt import seaborn as sns # reference: https://www.pycaret.org/ # reference: https://pycaret.org/guide/ # reference: https://github.com/pycaret/ # reference: https://pycaret.org/install/ # pip ...
github_jupyter
# Analyse de la *Bibliothèque* du pseudo-Apollodore ## Objectif Ce travail est lié à [ce projet](https://louislesueur.github.io/gods/). Le but est d'utiliser des outils de *Natural Language Processing* issus de la bibliothèque **CLTK** pour extraire les noms propres du texte et identifier les relations entre les pers...
github_jupyter
**Building a Model to Predict QB Pass Completion** *by Ben Diner* In American football, two teams of 11 players play on a rectangular field. The player in the quarterback position is the player who passes the football, and is generally seen as a leader of the team, calling plays and sometimes modifying them according ...
github_jupyter
# Quantization aware training in Keras example ## Overview Welcome to an end-to-end example for *quantization aware training*. **Learning Objectives** 1. Train a tf.keras model for MNIST from scratch. 2. Fine tune the model by applying the quantization aware training API, see the accuracy, and export a quantization...
github_jupyter
``` import warnings warnings.filterwarnings(action='once') import time import numpy as np import matplotlib.pyplot as plt %matplotlib inline from keras.datasets import cifar10 #loading data (x_train, y_train), (x_test, y_test) = cifar10.load_data() num_train, img_channels, img_rows, img_cols = x_train.shape num_test ...
github_jupyter
# Case Study 5 - SGD & SVM __Team Members:__ Amber Clark, Andrew Leppla, Jorge Olmos, Paritosh Rai # Content * [Business Understanding](#business-understanding) - [Scope](#scope) - [Introduction](#introduction) - [Methods](#methods) - [Results](#results) * [Data Evaluation](#data-evaluation) - [Lo...
github_jupyter
# Semantic Segmentation Inference using Neo-AI-DLR In this example notebook, we describe how to use a pre-trained Semantic Segmentation model for inference using the ***Neo-AI DLR*** interface. - The user can choose the model (see section titled *Choosing a Pre-Compiled Model*) - The models used in this example were t...
github_jupyter
``` # Import the necessary libraries import tensorflow as tf import tensorflow.keras as keras # This loads the EfficientNetB1 model from the Keras library # Input Shape is the shape of the image that is input to the first layer. For example, consider an image with shape (width, height , number of channels) # 'include_...
github_jupyter
``` # from google.colab import drive # drive.mount('/content/drive') import torch.nn as nn import torch.nn.functional as F import pandas as pd import numpy as np import matplotlib.pyplot as plt import torch import torchvision import torchvision.transforms as transforms from torch.utils.data import Dataset, DataLoader...
github_jupyter
![front1](jupyter_img/front1.png) ## This Jupyter notebook is available at https://github.com/dkp-quantum/Tutorials ## Further Information #### * Qiskit: https://qiskit.org #### * Qiskit GitHub: https://github.com/Qiskit ![cvsq](jupyter_img/cvsq.png) ![pillars](jupyter_img/TheoreticalPillarsQC.png) ![hardware](j...
github_jupyter
<a href="https://colab.research.google.com/github/vijishmadhavan/Crop-CLIP/blob/master/Crop_CLIP.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` #@title Install requirements %%capture !pip install -r https://raw.githubusercontent.com/ultralytics...
github_jupyter
<a href="https://colab.research.google.com/github/dishankkalra23/Medical-Appointment-No-Shows/blob/main/Medical_Appointment_No_Shows.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` import os os.environ['KAGGLE_USERNAME'] = 'replace_this_with_you...
github_jupyter
``` import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt %matplotlib inline plt.style.use("default") df=pd.read_csv("/content/train.csv") df.head(5) df.count() df.shape df.isnull().sum()# hence from here we can see that there are missing values in the train data set we must f...
github_jupyter
# SKNet + M = 2 + kernel_size = 3, dilation_rate = 1 + kernel_size = 3, dilation_rate = 2 Refernence: + [https://liaowc.github.io/blog/SKNet-structure/](https://liaowc.github.io/blog/SKNet-structure/) ![](https://i.imgur.com/HvOPnHS.png) + M:是分支數,也就是有幾種 kernel size。 + G:是各分支的卷積層做分組卷積的分組數。 + r: z 的維度為 d...
github_jupyter
# Pulling data from public APIs (without registration) - GET request ``` # loading the packages # requests provides us with the capabilities of sending an HTTP request to a server import requests ``` ## Extracting data on currency exchange rates ``` # We will use an API containing currency exchange rates as publishe...
github_jupyter
# Test reduced variance of gene expression data **Motivation**: When we plotted a volcano plot of the E-GEOD-51409 array experiment using the [actual data](volcano_original_data_E-GEOD-51409_example_adjp.png) and the [experiment-level simulated data](volcano_simulated_data_E-GEOD-51409_example_adjp.png), we found that...
github_jupyter
``` import matplotlib.pyplot as plt import numpy as np import pandas as pd import scipy as sp import scipy.io.wavfile as wavutils from sklearn.linear_model import LinearRegression from typing import Tuple from scipy.interpolate import interp1d def freq_calc(sig: np.ndarray, Ss: int) -> float: """Calculates the a...
github_jupyter
``` !pip install pandas !pip install numpy !pip install matplotlib.pyplot !pip install sklearn import numpy as np import matplotlib.pyplot as plt from sklearn.linear_model import LinearRegression !pip install matplotlib import numpy as np import matplotlib.pyplot as plt from sklearn.linear_model import LinearRegression...
github_jupyter
``` # 코드로 형식 지정됨 ``` #StyleGAN3 Reactive Audio By Derrick Schultz for the StyleGAN2 Deep Dive class. This notebook shows one basic example of how to alter your StyleGAN2 vectors with audio. There are lots of different techniques to explore in this, but this is one simple way. Big thanks to Robert Luxemburg who pr...
github_jupyter
# Purged KFold as a method The below was an issue that was reported in mlfinlab, which aroused my curiosity. Hence to test the relationship of PurgedKFold with different parameters. [https://github.com/hudson-and-thames/mlfinlab/issues/295#](https://github.com/hudson-and-thames/mlfinlab/issues/295#) At the same tim...
github_jupyter
<a href="https://colab.research.google.com/github/mattignal/article-summary-details/blob/main/Article_Summary_Details.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Summarization Exercise with Two Articles Can we quickly produce useful abstra...
github_jupyter
``` data_path = 'C:/PillView/NIH/nd320-c4-wearable-data-project-starter/data' data_path2 = 'D:/Datasets/competition_data/Training_data' import os from matplotlib import pyplot as plt import numpy as np import pandas as pd import glob import scipy.io import scipy as sp from fastai.vision.all import * import mpld3 %matpl...
github_jupyter
<a href="https://colab.research.google.com/github/ColmTalbot/gmm_sensitivity_estimation/blob/main/gmm_sensitivity_estimation.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Flexible and accurate evaluation of gravitational-wave Malmquist bias with...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt from scipy.signal import chirp, sweep_poly from librosa import cqt,stft, note_to_hz, pseudo_cqt from librosa.feature import melspectrogram import sys sys.path.insert(0,'../') from scipy.io import wavfile from nnAudio import Spectrogram import torch import torch.nn...
github_jupyter
<a href="https://colab.research.google.com/github/jeffheaton/t81_558_deep_learning/blob/master/t81_558_class_04_4_backprop.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 **Module 4: Training for Tabul...
github_jupyter
# Modeling and Simulation in Python Copyright 2018 Allen Downey License: [Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0) ``` # Configure Jupyter so figures appear in the notebook %matplotlib inline # Configure Jupyter to display the assigned value after an assignment %c...
github_jupyter
# Example Tool Usage - Regression Problems ---- # About This notebook contains simple, toy examples to help you get started with FairMLHealth tool usage. This same content is mirrored in the repository's main [README](../../../README.md) # Example Setup ``` from fairmlhealth import report, measure, stat_utils import...
github_jupyter
## 5. Visualização de dados A apresentação dos dados estatísticos através de tabelas ou medidas de centralidade e variabiliadade nem sempre proporciona um entendimento adequado dos dados. Assim, com a finalidade de melhorar esse processo, muitos recorrem ao uso dos gráficos. Para isso, é necessário saber o que se pre...
github_jupyter
``` %matplotlib inline import numpy as np import matplotlib.pyplot as plt from matplotlib.transforms import Affine2D import skimage.io # Write your imports here ``` # Visualizing Linear Transformations Write a code which visualizes a linear transformation. It should show "the old space" and "the new space" imposed on ...
github_jupyter
# Global Fishing Effort ``` import time import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap from matplotlib import colors,colorbar import matplotlib %matplotlib inline import csv import math # from scipy import stats import bq client = bq.Client.Get() def Query(q): t0 = t...
github_jupyter
<a id='top'></a> # Demonstration of the filters available in scipy.signal This notebook is not intended to replace the SciPy reference guide but to serve only as a one stop shop for the filter functions available in the signal processing module (see http://docs.scipy.org/doc/scipy/reference/signal.html for detailed i...
github_jupyter
# ***Introduction to Radar Using Python and MATLAB*** ## Andy Harrison - Copyright (C) 2019 Artech House <br/> # Optimum Binary Detection *** Binary integration is another form of noncoherent integration, often referred to as $M$ of $N$ detection, and is shown in Figure 6.10. In this form of integration, each of the...
github_jupyter
<a href="https://colab.research.google.com/github/NeuromatchAcademy/course-content/blob/master/tutorials/W1D5_DimensionalityReduction/student/W1D5_Tutorial1.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Tutorial 1: Geometric view of data **Week ...
github_jupyter
# Deploying Time-Series Models on Seldon The following notebook are steps to deploy your first time-series model on Seldon. The first step is to install statsmodels on our local system, along with s2i. s2i will be used to convert the source code to a docker image and stasmodels is a python library to...
github_jupyter
# Chapter 24 # Augmented Reality with OpenCV II 1. Augmented Reality ## Augmented Reality What is augmented Reality? 1. Combining reality with virtual 2. Placing object or element like virtual button switch on a wall. 3. Making reality beautiful by superimposing objects on real images. ## Class Activity 1. Use ...
github_jupyter
Центр непрерывного образования # Программа «Python для автоматизации и анализа данных» Неделя 2 - 1 *Татьяна Рогович, НИУ ВШЭ* ## Последовательности: списки и кортежи # Списки (list) Давайте представим, что при написании программы нам нужно работать, например, с большой базой данных студентов университета. Есл...
github_jupyter
``` import os os.chdir('../../') ``` ## GPU 设置 ``` GPUID='0'##调用GPU序号 os.environ["CUDA_VISIBLE_DEVICES"] = GPUID import numpy as np import tensorflow as tf from glob import glob from PIL import Image import cv2 Input =tf.keras.layers.Input Lambda = tf.keras.layers.Lambda load_model = tf.keras.models.load_model Model ...
github_jupyter
Before you turn this problem in, make sure everything runs as expected. First, **restart the kernel** (in the menubar, select Kernel$\rightarrow$Restart) and then **run all cells** (in the menubar, select Cell$\rightarrow$Run All). Make sure you fill in any place that says `YOUR CODE HERE` or "YOUR ANSWER HERE", as we...
github_jupyter
# Word prediction based on Pentagram This program reads the corpus line by line so it is slower than the program which reads the corpus in one go.This reads the corpus one line at a time loads it into the memory ## Import corpus ``` #%%timeit from nltk.util import ngrams from collections import defaultdict import nlt...
github_jupyter
## Paper visualizations ``` !pip install --user neural_renderer_pytorch import os import imageio import trimesh import torch import numpy as np import matplotlib as mpl import matplotlib.cm as cm import matplotlib.pyplot as plt %matplotlib inline import neural_renderer as nr from scipy.spatial import cKDTree as KDTr...
github_jupyter
# Fleet Predictive Maintenance: Part 3 ## Data Preparation: Featurization and Exploratory Data Visualization *Using SageMaker Studio to Predict Fault Classification* 1. [Architecure](0_usecase_and_architecture_predmaint.ipynb#0_Architecture) 1. [Data Prep: Processing Job from Data Wrangler Output](./1_dataprep_dw_job_...
github_jupyter
``` #!/usr/bin/python3 # coding=utf-8 import scipy.optimize as optimize from numpy import genfromtxt def manual_gd(f_, x_old=0, x_new=5, learningRate=0.1, precision=0.00001): """ A simple gradient descent usage for function optimization """ iteration = 0 while abs(x_new - x_old) > precision: ...
github_jupyter
## Dependencies ``` !pip install --quiet /kaggle/input/kerasapplications !pip install --quiet /kaggle/input/efficientnet-git import math, os, re, warnings, random, glob import numpy as np import pandas as pd import tensorflow as tf import tensorflow.keras.layers as L import tensorflow.keras.backend as K from tensorflo...
github_jupyter
### GeostatsPy: Confidence Intervals and Hypothesis Testing for Subsurface Data Analytics in Python #### Michael Pyrcz, Associate Professor, University of Texas at Austin ##### [Twitter](https://twitter.com/geostatsguy) | [GitHub](https://github.com/GeostatsGuy) | [Website](http://michaelpyrcz.com) | [GoogleSchola...
github_jupyter
## Please input your directory for the top level folder folder name : SUBMISSION MODEL ``` dir_ = 'INPUT-PROJECT-DIRECTORY/submission_model/' # input only here ``` #### setting other directory ``` raw_data_dir = dir_+'2. data/' processed_data_dir = dir_+'2. data/processed/' log_dir = dir_+'4. logs/' model_dir = dir_...
github_jupyter
## Week 8: Reinforcement Learning for seq2seq This time we'll solve a problem of transribing hebrew words in english, also known as g2p (grapheme2phoneme) * word (sequence of letters in source language) -> translation (sequence of letters in target language) Unlike what most deep learning practicioners do, we won't...
github_jupyter
# Using crack submodels in PyBaMM In this notebook we show how to use the crack submodel with battery DFN or SPM models. To see all of the models and submodels available in PyBaMM, please take a look at the documentation [here](https://pybamm.readthedocs.io/en/latest/source/models/index.html). ``` %pip install pybamm ...
github_jupyter
``` from pulp import * problem = LpProblem("Marketing Spend", LpMaximize) # Setup Sets markets = ["Facebook", "Instagram", "Twitter"] saturation_level = [1, 2] buckets = [1, 2] # Setup Data clicks_per_dollar = {("Facebook", 1):0.10, ("Facebook", 2):0.20, \ ("Instagram", 1):0.12, ("Instagram", 2...
github_jupyter
# Housing Rental Analysis for San Francisco In this challenge, your job is to use your data visualization superpowers, including aggregation, interactive visualizations, and geospatial analysis, to find properties in the San Francisco market that are viable investment opportunities. Instructions: Use the `san_franci...
github_jupyter
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/onnx/onnx-modelzoo-aml-deploy-resnet50.png) # ResNet50 Image Classification using ONNX ...
github_jupyter
# Code Snippets for Intro to TensorFlow Talk @ PyData Ann Arbor Aug 2017 GitHub Repo: https://github.com/rasbt/pydata-annarbor2017-dl-tutorial ``` %load_ext watermark %watermark -a 'Sebastian Raschka' -v -p tensorflow,numpy ``` ## Vectorization ``` import numpy as np np.random.seed(123) num_train_examles = 150 ...
github_jupyter
## K-Nearest Neighbor Algoritm ### KNN is a classification algorithm. It is basic to understand. K is the number of neighbors you want to look at. Algorithm looks at the classes of nearest k points and classify the point if a class have more points that are nearest to point. ### Import Libraries ### I will only use ...
github_jupyter
### Questions Classification Custom dataset. In this notebook we are going to learn how to load the questions dataset using torchtext and prepare it for sentiment classification in pytorch. We are going to use [this series](https://github.com/CrispenGari/pytorch-python/tree/main/09_TorchText/02_Sentiment_Analyisis_Ser...
github_jupyter
# Section 0 - Jupyter Notebook and Markdown Syntax ## Author: Gustavo Amarante The jupyter notebook is an interactive programming environment that is made up of **code cells** and **text cells**. Text cells allow you to use not only plain text but also some commands to format it. These commands are called the **Markdo...
github_jupyter
``` import tensorflow as tf print(tf.__version__) from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Flatten, Softmax # Build the Sequential feedforward neural network model model = Sequential([Flatten(input_shape = (28,28))]) model.add(Dense(16, activation = 'relu')) model.add(De...
github_jupyter
``` %matplotlib inline import numpy as np import networkx as nx import pandas as pd from matplotlib import pyplot as plt from matplotlib import cm from bokeh.io import output_file, show from bokeh.plotting import figure, from_networkx import datashader as ds import datashader.transfer_functions as tf from bokeh.models...
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
# 3. Content based model This notebook is about creating a content based recommendation model with the tmdb dataset. In contrast to collaborative filetering models where the user ratings are taken into account, contet based models are, as the name implies, based only on the conent of items. To define the conent, Natur...
github_jupyter
# How to make a histogram from scratch --- Step by step implementation from scratch the figure was implemented using only the matplotlib basic functions. * nice instruction on how to create a histogram: https://www.youtube.com/watch?v=gSEYtAjuZ-Y ``` import numpy as np import math as math import matplotlib.pyp...
github_jupyter
<a href="https://colab.research.google.com/github/ashikshafi08/Learning_Tensorflow/blob/main/Other%20Courses/Getting_Started_with_TensorFlow.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> This notebook contains all the materials and notes for the G...
github_jupyter