text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
KnockoffDB --- This class is responsible for building the tables and inserting the data into the database. It accomplishes this using a **KnockoffDatabaseService** provided to its \_\_init\_\_ to interact with the database for getting table definitions and uploading knockoff data. The **DefaultDatabaseService** is an ...
github_jupyter
``` import xarray as xr import numpy as np import pandas as pd import matplotlib.pyplot as plt #import seawater as sw import cartopy.crs as ccrs # import projections import cartopy.feature as cf # import features from pandas import ExcelWriter fig_dir='C:/Users/gentemann/Google Drive/...
github_jupyter
# Solutions to Exercises For each exercise, the solutions below show one possible way of solving it, but you might have used a different approach, and that's great! There is almost always more than one way to solve any particular problem in Python. **Note**: To run this notebook, you'll need to either a) move it up o...
github_jupyter
#### URI Converters (configurable) [id_converter_link]: https://github.com/Rothamsted/rdf2neo/blob/master/rdf2neo/src/main/java/uk/ac/rothamsted/rdf/neo4j/idconvert/DefaultIri2IdConverter.java These converters allow us to simplify the representation of URIs. They can be configured to perform custom conversion withi...
github_jupyter
# K-mer comparisons! This is a Jupyter Notebook using Python 3. You can use Shift-ENTER to run cells, and double click on code cells to edit them. Contact: C. Titus Brown, ctbrown@ucdavis.edu ## Calculating Jaccard similarity and containment Given any two collections of k-mers, we can calculate similarity and conta...
github_jupyter
``` import random import matplotlib.pyplot as plt import math import alignments as alg import utils human = utils.read_protein('data/alg_HumanEyelessProtein.txt') fly = utils.read_protein('data/alg_FruitflyEyelessProtein.txt') #print(len(human)) #print(len(fly)) scoring_matrix = utils.read_scoring_matrix('data/alg_PAM...
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
**Chapter 16 – Natural Language Processing with RNNs and Attention** _This notebook contains all the sample code in chapter 16._ <table align="left"> <td> <a target="_blank" href="https://colab.research.google.com/github/ageron/handson-ml2/blob/master/16_nlp_with_rnns_and_attention.ipynb"><img src="https://www....
github_jupyter
# Description This notebook computes predicted expression correlations between all genes in the MultiPLIER models. It also has a parameter set for papermill to run on a single chromosome to run in parallel (see under `Settings` below). # Modules ``` %load_ext autoreload %autoreload 2 import numpy as np from scipy.s...
github_jupyter
``` """ The MIT License (MIT) Copyright (c) 2021 NVIDIA Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, pub...
github_jupyter
# Cross Validation ``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns df = pd.read_csv('../Data/Advertising.csv') df.head() ``` ---- ---- ---- ## Train | Test Split Procedure 0. Clean and adjust data as necessary for X and y 1. Split Data in Train/Test for both X and y ...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Reducer/using_weights.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target="_blank" href="...
github_jupyter
``` # First XGBoost model for Pima Indians dataset import xgboost from numpy import loadtxt from xgboost import XGBClassifier from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score # load data dataset = loadtxt('pima-indians-diabetes.csv', delimiter=",") # split data into X and ...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt import requests import csv from bs4 import BeautifulSoup from datetime import datetime, timedelta import statsmodels.api as sm from statsmodels.tsa import stattools from statsmodels.tsa.seasonal import seasonal_decompose from statsmodels.graphi...
github_jupyter
In this lab, we will optimize the weather simulation application written in Fortran (if you prefer to use C++, click [this link](../../C/jupyter_notebook/profiling-c.ipynb)). Let's execute the cell below to display information about the GPUs running on the server by running the nvaccelinfo command, which ships with t...
github_jupyter
## Define the Convolutional Neural Network After you've looked at the data you're working with and, in this case, know the shapes of the images and of the keypoints, you are ready to define a convolutional neural network that can *learn* from this data. In this notebook and in `models.py`, you will: 1. Define a CNN w...
github_jupyter
# Complete guide ## Introduction This Notebook contains an overview of the basic functionality of the simulator. It introduces the simplest ways to get started with the simulator, and it dives into more advanced concepts that will allow you to get a sense of the flexibility of the system. At the end of this guide, yo...
github_jupyter
``` import numpy as np import pandas as pd import pylab as plt from matplotlib.font_manager import FontProperties from collections import OrderedDict import matplotlib.colors as colors import matplotlib.cm as cmx from mpl_toolkits.axes_grid1 import make_axes_locatable # DDF summary on the COIN server: file_extension ...
github_jupyter
![](img/572_banner.png) # Lab 1: Floating Point Numbers, Optimization & Gradient Descent **Tomas Beuzen, January 2021** In this lab, we'll work on solidifying concepts learned in Lecture 1 (floating point numbers) and Lecture 2 (optimization & gradient descent). This is the "vegetables" lab of the course - you're pr...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_parent" href="https://github.com/giswqs/geemap/tree/master/tutorials/ImageCollection/03_filtering_image_collection.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target...
github_jupyter
``` import matplotlib.pyplot as plt import numpy as np import tifffile as tiff import keras.backend as K from keras.metrics import binary_crossentropy from math import sqrt from skimage.transform import resize import logging import sys import tensorflow as tf import sys; #sys.path.append('../') from src.models.unet_dil...
github_jupyter
``` import pandas as pd from sklearn.mixture import GaussianMixture import numpy as np np.set_printoptions(precision=6) import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from scipy.stats import multivariate_normal data = pd.read_csv('for_tus.csv') data.head() data_np = data.to_numpy() print(da...
github_jupyter
``` import meds import numpy as np import galsim import fitsio import seaborn as sns import matplotlib.pyplot as plt %matplotlib notebook import os band = 'i' tilename = 'DES2122+0001' MEDS_DIR = 'outputs-%s' % tilename MEDSCONF = 'y3v02' meds_path = os.path.join( MEDS_DIR, 'meds', MEDSCONF, tilenam...
github_jupyter
### 1. EDA ___ ``` import pandas as pd import numpy as np import matplotlib.pyplot as plt import os.path from sklearn.cluster import KMeans, DBSCAN, OPTICS from sklearn.decomposition import PCA from sklearn.manifold import TSNE import seaborn as sns import spectrai as spa sns.set_context('notebook') %load_ext autorel...
github_jupyter
# Builder Tutorial number 6 The builder tutorials demonstrate how to build an operational GSFLOW model using `pyGSFLOW` from shapefile, DEM, and other common data sources. These tutorials focus on the `gsflow.builder` classes. ## Building modflow input files In this tutorial, we demonstrate how to build modflow inpu...
github_jupyter
# 吉布斯态的制备 <em> Copyright (c) 2021 Institute for Quantum Computing, Baidu Inc. All Rights Reserved. </em> ## 概览 在本案例中,我们将展示如何通过 Paddle Quantum 训练量子神经网络(quantum neural network, QNN)来制备量子吉布斯态。 ### 背景 量子计算中的前沿方向包含量子机器学习和量子优化,在这两个方向中,特定量子态的制备是非常重要的问题。特别的,吉布斯态(Gibbs state)的制备是实现诸多量子算法所必须的步骤并且广泛应用于: - 量子机器学习中受限波尔兹曼机的学习 ...
github_jupyter
# Clustering Tutorial This guide will show how to use Tribuo’s clustering models to find clusters in a toy dataset drawn from a mixture of Gaussians. We'll look at Tribuo's K-Means implementation and also discuss how evaluation works for clustering tasks. ## Setup We'll load in some jars and import a few packages. ...
github_jupyter
This notebook is part of the `nbsphinx` documentation: https://nbsphinx.readthedocs.io/. # Code Cells ## Code, Output, Streams An empty code cell: Two empty lines: ``` ``` Leading/trailing empty lines: ``` # 2 empty lines before, 1 after ``` A simple output: ``` 6 * 7 ``` The standard output stream: ``` pr...
github_jupyter
# Machine Learning Engineer Nanodegree ## Unsupervised Learning ## Project: Creating Customer Segments Welcome to the third project of the Machine Learning Engineer Nanodegree! In this notebook, some template code has already been provided for you, and it will be your job to implement the additional functionality nece...
github_jupyter
``` import sys import os import pandas as pd import numpy as np from rdkit import Chem import rdkit.Chem.rdmolops as rdmolops # If you installed the code from source and the import fails with the following error: # (ModuleNotFoundError: No module named 'solvation_predictor') # Make sure that you have activated the ...
github_jupyter
### Import Modules --- ``` # TEMP import os print(os.getcwd()) import sys import pickle import numpy as np import plotly.graph_objs as go from sklearn.linear_model import LinearRegression # ######################################################### from methods import get_df_features_targets ``` ### Read Data `...
github_jupyter
``` """ The MIT License (MIT) Copyright (c) 2021 NVIDIA Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, pub...
github_jupyter
# An RNN model to generate sequences RNN models can generate long sequences based on past data. This can be used to predict stock markets, temperatures, traffic or sales data based on past patterns. They can also be adapted to [generate text](https://docs.google.com/presentation/d/18MiZndRCOxB7g-TcCl2EZOElS5udVaCuxnGzn...
github_jupyter
# Pytorch Tutorial ### 1. Tensors and Dynamic Graphs - Basic Operations involving ```torch.Tensor```. - Introduction to the dynamic graphs of ```torch.Autograd```. Setup torch and some variables ``` import torch a = torch.ones(4,5) * 2 b = torch.ones(4,5) * 3 print('Tensor a:') print(a) print() print('Tensor b:') p...
github_jupyter
# 基础因子实时计算 ``` %matplotlib inline import sys sys.path.append('../') sys.path.append('../../') sys.path.append('../../../') sys.path.append('../../../../') sys.path.append('../../../../../') import pandas as pd import numpy as np import seaborn as sns from datetime import datetime from matplotlib import pyplot as plt ...
github_jupyter
<a href="https://colab.research.google.com/github/hinsley/colabs/blob/master/Pre_Swap_Gauss_Jordan_Elimination.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> This notebook is pretty old and may not be perfect. ``` import numpy as np example_matri...
github_jupyter
# An introduction to the project-k FORTH kernel `project-k` is a very small FORTH programming language kernel supporting Javascript and Python open-sourced on GitHub https://github.com/hcchengithub/project-k. We are going to use this FORTH kernel to build our own tiny FORTH programming language system. ### Read only...
github_jupyter
# Multiple Regression Simple Linear Regression: $$y = \beta_0 + \beta_1X$$ Multiple Linear Regression: $$y = \beta_0 + \beta_1X_1 + \beta_2X_2 + ...$$ Well studied field in statistics Focus will be on what is relevant for Data Science - practical and relevant for prediction ``` import numpy as np import pandas a...
github_jupyter
# Pandas TA ([pandas_ta](https://github.com/twopirllc/pandas-ta)) Strategies for Custom Technical Analysis ## Topics - What is a Pandas TA Strategy? - Builtin Strategies: __AllStrategy__ and __CommonStrategy__ - Creating Strategies - Watchlist Class - Strategy Management and Execution - **NOTE:** The *...
github_jupyter
This notebook was prepared by [Donne Martin](http://donnemartin.com). Source and license info is on [GitHub](https://github.com/donnemartin/data-science-ipython-notebooks). # Functions * Functions as Objects * Lambda Functions * Closures * \*args, \*\*kwargs * Currying * Generators * Generator Expressions * itertools...
github_jupyter
### SVM ``` import numpy as np import matplotlib.pyplot as plt import scipy.io as scio from sklearn import svm train_data = scio.loadmat("./ex6data1.mat") # print(train_data) X = train_data['X'] Y = train_data['y'] print(X.shape, Y.shape) def plot_data(X, Y): positive = X[Y[:,0] == 1] negative = X[Y[:,0] == 0]...
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
# بسم الله الرحمن الرحيم ``` # Load image import cv2 image = cv2.imread("img/red_panda.jpg") gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) cv2.imshow("Gray panda", gray_image) cv2.imshow("Red panda", image) cv2.waitKey(0) cv2.destroyAllWindows() # Save image import cv2 image = cv2.imread("img/red_panda.jpg")...
github_jupyter
### Program written by Scott Midgley, 2021 Scope: To train and test LR models for band gap energy screening in the configuraional space of MgO-ZnO solid solutions. ``` ### USER INPUT REQUIRED ### # Please paste in the path to the repositiory here an comment/uncomment as needed. # E.g. rundir = r'C:\Users\<user>\Desk...
github_jupyter
![Egeria Logo](https://raw.githubusercontent.com/odpi/egeria/master/assets/img/ODPi_Egeria_Logo_color.png) ### Egeria Hands-On Lab # Welcome to the Understanding Cohort Configuration Lab ## Introduction Egeria is an open source project that provides open standards and implementation libraries to connect tools, catal...
github_jupyter
## **3. PCA** ### **a)** ``` import pandas as pd from sklearn.datasets import load_breast_cancer cancer_data = load_breast_cancer() data = pd.DataFrame(cancer_data.data,columns=cancer_data.feature_names) data.head(3) ``` <hr style = "border-top: 3px solid #000000 ; border-radius: 3px;"> <p style =" direction:rtl;te...
github_jupyter
## Obligatory imports ``` import numpy as np import matplotlib import matplotlib.pyplot as plt import matplotlib import seaborn as sns import sklearn %matplotlib inline matplotlib.rcParams['figure.figsize'] = (10,6) ``` # MNIST Dataset ``` # Please click "Stay on page" on the popup! import IPython.core.display impor...
github_jupyter
## Dependencies ``` import os, random, warnings import numpy as np import pandas as pd import seaborn as sns from matplotlib import pyplot as plt from sklearn.model_selection import train_test_split from transformers import TFDistilBertModel from tokenizers import BertWordPieceTokenizer import tensorflow as tf from te...
github_jupyter
<table> <tr align=left><td><img align=left src="./images/CC-BY.png"> <td>Text provided under a Creative Commons Attribution license, CC-BY. All code is made available under the FSF-approved MIT license. (c) Kyle T. Mandli</td> </table> ``` from __future__ import print_function from __future__ import absolute_import ...
github_jupyter
# Classification of Localizer Data ## Import necessary packages ``` %matplotlib inline import glob import os.path as op import os as os import nibabel as nib import pandas as pd import numpy as np from nilearn.masking import compute_epi_mask import matplotlib.pyplot as plt import matplotlib as mpl # Nilearn for ne...
github_jupyter
``` import numpy as np import pandas as pd import time import matplotlib.pyplot as plt import seaborn as sns import random from bayes_opt import BayesianOptimization sns.set() BayesianOptimization? np.around? def get_state(data, t, n): d = t - n + 1 block = data[d:t + 1] if d >= 0 else -d * [data[0]] + data[0:t...
github_jupyter
# This is a live demo of video action recognition using two-stream architecture This will clone my repo and download the models on drive and uses them to infer the output in a live frame-level demo. then an output video will be generated showing the output prediction for each frame accordingly. I suggest running all...
github_jupyter
# Gaussian Processes ## Introduction [Gaussian Processes](https://en.wikipedia.org/wiki/Gaussian_process) have been used in supervised, unsupervised, and even reinforcement learning problems and are described by an elegant mathematical theory (for an overview of the subject see [1, 4]). They are also very attractive ...
github_jupyter
``` %load_ext autoreload %autoreload 2 import datetime import os import numpy as np import matplotlib.pyplot as plt import casadi as cas import car_plotting as cp %matplotlib inline cp.plot_cars(x, x, x) arr_img = plt.imread('red_car.png', format='png') imagebox = OffsetImage(arr_img, zoom=1.0) #this zoom is to sc...
github_jupyter
[![imagenes/pythonista.png](imagenes/pythonista.png)](https://pythonista.io) # Creación y lectura de archivos en formato *PDF*. El formato *PDF* es un [estándar internacional](https://www.iso.org/standard/51502.html) para la creación de documentos que pueden ser desplegados o impresos de forma idéntica independientem...
github_jupyter
## Проверка пайплайна обучения pix2pix для датасета MNIST ##### Задача image2image: научить сетку сдвигать числа на расстояние и в направлении, выбранными пользователем ![image-2.png](attachment:image-2.png) ``` import torch from torch import nn from torch.utils.data import Dataset, DataLoader import torch.nn.funct...
github_jupyter
#### Using SimpleElastix register all non class 1 CT scans and attempt to normalize them into a **healthy** CT scan. ``` import sys import os import csv from collections import Counter from configparser import ConfigParser from glob import glob import SimpleITK as sitk # pip install SimpleITK from tqdm import tqdm # p...
github_jupyter
### JaneStreet ### Plain NN ``` # Network for Jane Street Market Prediction on Kaggle # https://www.kaggle.com/c/jane-street-market-prediction # https://www.kaggle.com/wrinkledtime # https://github.com/timestocome # The Jane Street competition has blinded data and the goal is to predict stock market winners 6 months f...
github_jupyter
``` import io import sys import random import string import numpy as np from keras.models import Sequential from keras.layers import Dense from keras.layers import GRU from keras.optimizers import RMSprop def load_text(filename): with open(filename, 'r') as f: text = f.read() return text file_poem = '...
github_jupyter
# <center> *mocalum* tutorial 4 <br><br> Monte-Carlo simulation for single-Doppler configuration <center> A notebook by Nikola Vasiljević ## Introduction In this section we will calculate wind speed uncertainty of a single-Doppler setup by means of Monte-Carlo simulations. We will consider a sector-scanning lida...
github_jupyter
## A Wild Demo Grouper ``` 为明确步骤,以下方法逻辑有冗余(包括代码先后顺序是不合理的),实际运行推荐使用C或Spark ``` ### 0. Review #### 0.0. DRG 基本概念 > **疾病诊断相关组(Diagnosis Related Groups,DRG)**是用于衡量 医疗服务质量效率以及进行医保支付的一个重要工具。DRG 实质上 是一种病例组合分类方案,即根据年龄、疾病诊断、合并症、并发症、 治疗方式、病症严重程度及转归和资源消耗等因素,将患者分入若干 诊断组进行管理的体系。 #### 0.1. DRG 付费适用范围 ##### 适用范围 >DRG 是以划分医疗服务产出为目...
github_jupyter
# Iris Training and Prediction with Sagemaker Scikit-learn ### Modified Version of AWS Example: https://github.com/awslabs/amazon-sagemaker-examples/blob/master/sagemaker-python-sdk/scikit_learn_iris/Scikit-learn%20Estimator%20Example%20With%20Batch%20Transform.ipynb Following modifications were made: 1. Incorpora...
github_jupyter
# XFOIL ## Overview XFOIL is a design and analysis tool for subsonic airfoils developed by Mark Drela at MIT. The [XFOIL website](https://web.mit.edu/drela/Public/web/xfoil/) contains more info. ## Setup As with the previous AVL tutorial, a copy of the XFOIL executable must be somewhere on your computer in order t...
github_jupyter
# Convolutional Neural Networks: Application Welcome to Course 4's second assignment! In this notebook, you will: - Implement helper functions that you will use when implementing a TensorFlow model - Implement a fully functioning ConvNet using TensorFlow **After this assignment you will be able to:** - Build and t...
github_jupyter
# Chunking strategies for a Wide-ResNet This tutorial shows how to utilize a hypernet container [HContainer](../hnets/hnet_container.py) and class [StructuredHMLP](../hnets/structured_mlp_hnet.py) (a certain kind of hypernetwork that allows *smart* chunking) in combination with a Wide-ResNet [WRN](../mnets/wide_resnet...
github_jupyter
``` import numpy as np import pandas as pd from matplotlib import pyplot as plt from tqdm import tqdm %matplotlib inline from torch.utils.data import Dataset, DataLoader import torch import torchvision import torch.nn as nn import torch.optim as optim from torch.nn import functional as F device = torch.device("cuda" i...
github_jupyter
# Sums of functions duplicated over a lattice This example illustrates a method for evaluating sums of the form $$ F(\mathbf{r}) = \sum_{\mathbf{t}} \sum_{i=1}^{n_f} f\left(\mathbf{r}-\mathbf{t}-\mathbf{r}_i\right), $$ where each $\mathbf{t}$ points to the origin of one cell in an infinite lattice and the vecto...
github_jupyter
``` from database.market import Market from database.sec import SEC import pandas as pd import pandas_datareader as pdr from transformer.date_transformer import DateTransformer from transformer.column_transformer import ColumnTransformer from datetime import datetime import matplotlib.pyplot as plt from tqdm import tqd...
github_jupyter
# <span style="color:green"> Numerical Simulation Laboratory (NSL) </span> ## <span style="color:blue"> Numerical exercises 8</span> During this exercise you will variationally optimize the ground state of a single quantum particle in a one dimensional (1D) space confined by the following external potential: $$ V(x) ...
github_jupyter
``` %matplotlib inline # Packages import os, glob, scipy, sys import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from scipy.cluster.hierarchy import dendrogram, linkage from scipy.spatial.distance import pdist # Project directory base_dir = os.path.realpath('..') print(base_d...
github_jupyter
## Dataloaders for Machine Learning (Tensorflow & PyTorch) This tutorial acts as a step by step guide for fetching, preprocessing, storing and loading the [MS-COCO](http://cocodataset.org/#home) dataset for image captioning using deep learning. We have chosen **image captioning** for this tutorial not by accident. For...
github_jupyter
``` import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from sklearn import preprocessing from sklearn.ensemble import RandomForestClassifier from sklearn import svm from sklearn.metrics import precision_score, recall_score import matplotlib.pyplot as plt #reading train.csv data ...
github_jupyter
``` %matplotlib inline import numpy as np from numpy.random import normal, randint import matplotlib.pyplot as plt import time import sys import gc from sklearn.neural_network import MLPRegressor from sklearn.model_selection import train_test_split # Pyplot config font = {'family': 'normal', 'weight': 'normal'...
github_jupyter
# 10. Критерии однородности. Есть 2 выборки $X_{[n]}$ и $Y_{[m]}$, нужно понять взяты ли они из одного распределения ## Критерий равенства матожиданий [Теория](www.mathprofi.ru/proverka_statisticheskih_gipotez.html) Статистика для равенства матожиданий $Z = \frac{(\overline{X} - \overline{Y}) - (a_X - a_Y)}{\sqrt{\...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Objectives" data-toc-modified-id="Objectives-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Objectives</a></span></li><li><span><a href="#Spark:-Getting-Started" data-toc-modified-id="Spark:-Getting-Star...
github_jupyter
<a href="https://colab.research.google.com/github/nmningmei/Deep_learning_fMRI_EEG/blob/master/Han_et_al_2019_VAE_and_fMRI.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` from PIL import Image ``` # Introduction 1. understanding the human visu...
github_jupyter
<a href="https://colab.research.google.com/github/RahulBarman101/Face-Gan/blob/master/gans.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` !wget http://vis-www.cs.umass.edu/lfw/lfw.tgz import tarfile my_tar = tarfile.open('lfw.tgz') my_tar.extra...
github_jupyter
### Decision Tree Algorithm * Implemented From Scratch ``` import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import random ``` ### Data Loading & Preparation ``` df=pd.read_csv('iris.csv') df.rename(columns={'Name':'Label'},inplace=True) df.head() sns.lmplot(x='PetalWidth'...
github_jupyter
# LinearSVR with Scale & Polynomial Features This Code template is for the Classification task using Linear Support Vector Regression(LinearSVR) based on the Support Vector Machine algorithm with PolynomialFeatures as Feature Transformation Technique, rescaling technique scaling in a pipeline # Required Packages ``...
github_jupyter
# Goal The goal of this notebook is to extract the **kkanji.tar** file which results in an extraction of 1 folder with 3.832 subfolders which are named with the correspondent unicode name. Each subfolder consists of png files of the Kanji characters. To make it easier to process and share the data, i converted all ima...
github_jupyter
# 9. Convolutional Neural Network with PyTorch ## 1. About Convolutional Neural Network ### 1.1 Transition From Feedforward Neural Network #### 1 Hidden Layer Feedforward Neural Network <img src="./images/nn1_new.png" alt="deeplearningwizard" style="width: 900px;"/> #### Basic Convolutional Neural Network - Addition...
github_jupyter
# RadarCOVID-Report ## Data Extraction ``` import datetime import json import logging import os import shutil import tempfile import textwrap import uuid import matplotlib.pyplot as plt import matplotlib.ticker import numpy as np import pandas as pd import pycountry import retry import seaborn as sns %matplotlib in...
github_jupyter
# Sentiment Analysis: Primera Exploración Ya tenemos un buen modelo. Queremos mejorarlo. Las opciones son tantas que el enfoque es explorar superficialmente cada una. ``` %load_ext autoreload %autoreload 2 from util import load_datasets train, dev, test = load_datasets() X_train, y_train = train X_dev, y_dev = dev X...
github_jupyter
# AutoML for Text Classification ## Learning Objectives 1. Learn how to create a text classification dataset for AutoML using BigQuery 1. Learn how to train AutoML to build a text classification model 1. Learn how to evaluate a model trained with AutoML 1. Learn how to predict on new test data with AutoML ## Introdu...
github_jupyter
# Scoring your trained model In the cell below, please load your model into `model`. Also if you used an image size for your input images that *isn't* 224x224, you'll need to set `image_size` to the size you used. The scoring code assumes square input images. For example, this is how I loaded in my checkpoint: ```py...
github_jupyter
# Pedestrian example of subscribing to a DataSet It is possible to *subscribe* to a dataset. Subscribing means adding a function to the dataset and having the dataset call that function every time a result is added to the dataset (or more rarely, see below). ### Call signature The subscribing function must have the ...
github_jupyter
# Post-training dynamic range quantization **Learning Objectives** 1. We will learn how to train a TensorFlow model. 2. We will learn how to load the model into an interpreter. 3. We will learn how to evaluate the models. ## Introduction [TensorFlow Lite](https://www.tensorflow.org/lite/) now supports converti...
github_jupyter
<p><font size="6"><b> CASE - Bike count data</b></font></p> > *© 2021, Joris Van den Bossche and Stijn Van Hoey (<mailto:jorisvandenbossche@gmail.com>, <mailto:stijnvanhoey@gmail.com>). Licensed under [CC BY 4.0 Creative Commons](http://creativecommons.org/licenses/by/4.0/)* --- <img src="https://static.nieuwsblad....
github_jupyter
``` import os import numpy as np import cv2 import random coco_dict = {} with open("coco.names", "r") as f: ls = f.readlines() i=0 for cls in ls: coco_dict[cls.strip("\n")] = i i=i+1 f.close() imagespath = "./ExDark/" annotationspath = "./ExDark_Annno/" classes = os.listdir(images...
github_jupyter
# Evaluation with ML The point of this section is to check whether the generated data can be used to train new models. I will do this mostly by training a classifier on the generated data and then perform inference on the original data. The 'test set' data will in this case give a good indication of how usable the data...
github_jupyter
# Create undersampled k-space This demonstration shows how to create different undersampled k-space data which can be used either directly for image reconstruction or used to simulate MR data acquisition of a new object. This demo is a 'script', i.e. intended to be run step by step in a Python notebook such as Jupyter...
github_jupyter
# Explainable AI [作業說明投影片](https://docs.google.com/presentation/d/13xUwWArz0LROgyJBwGCf1Vili5u7l4K6WcyuRxxakAo/) [Homework Introduction](https://docs.google.com/presentation/d/13xUwWArz0LROgyJBwGCf1Vili5u7l4K6WcyuRxxakAo/) 本作業不提供 python script 版本 There is no python script version for this homework 若有任何...
github_jupyter
# Lab: Transfer Learning Welcome to the lab on Transfer Learning! Here, you'll get a chance to try out training a network with ImageNet pre-trained weights as a base, but with additional network layers of your own added on. You'll also get to see the difference between using frozen weights and training on all layers. ...
github_jupyter
``` from IPython.core.display import HTML with open('style.css', 'r') as file: css = file.read() HTML(css) ``` # Die Bekehrung der Ungläubigen Drei Missionare und drei Ungläubige wollen zusammen einen Fluss überqueren, denn die Ungläubigen sollen in der Kirche, die sich auf dem anderen Ufer befindet, getauft werd...
github_jupyter
## Creating Landsat Timelapse **Steps to create a Landsat timelapse:** 1. Pan and zoom to your area of interest, or click the globe icon at the upper left corner to search for a location. 2. Use the drawing tool to draw a rectangle anywhere on the map. 3. Adjust the parameters (e.g., start year, end year, title) if n...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Learn-to-Augment-Images-and-Multiple-Bounding-Boxes-for-Deep-Learning-in-4-Steps" data-toc-modified-id="Learn-to-Augment-Images-and-Multiple-Bounding-Boxes-for-Deep-Learning-in-4-Steps-1"><span class="toc-i...
github_jupyter
## Load data files ``` import codecs from keras.utils.np_utils import to_categorical import numpy as np def load_data(filename): data = list(codecs.open(filename, 'r', 'utf-8').readlines()) x, y = zip(*[d.strip().split('\t') for d in data]) x = np.asarray(list(x)) y = to_categorical(y, 3) ret...
github_jupyter
``` from __future__ import print_function import tensorflow as tf from tensorflow import keras from keras.preprocessing.image import ImageDataGenerator from keras.models import Sequential from keras.layers import Dense,Dropout,Activation,Flatten,BatchNormalization from keras.layers import Conv2D,MaxPooling2D import os ...
github_jupyter
## Requirements Before using this tutorial, ensure that the following are on your system: - <b>SteganoGAN is installed</b>. Install via pip or source code. - <b>Training and Validation Dataset are available </b>. Download via data/download.sh or retrieve your own. It is also suggested that you have the following: ...
github_jupyter
# Los diccionarios Son junto a las listas las colecciones más utilizadas. Se basan en una estructura mapeada donde cada elemento de la colección se encuentra identificado con una clave única. Por tanto, no puede haber dos claves iguales. En otros lenguajes se conocen como arreglos asociativos. ``` vacio = {} vacio ```...
github_jupyter