text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
# Code Lab 4B: RNN for Text Classification
This notebook consist of 4 main sections:
1. Preparing the data
2. Implementing a simple LSTM (RNN) model
3. Training the model
4. Evaluating the model
**Key Model Parameters**
```
MAX_NB_WORDS = 100000 # max no. of words for tokenizer
MAX_SEQUENCE_LENGTH = 20 # max len... | github_jupyter |
```
from urllib.request import Request, urlopen
import requests
from bs4 import BeautifulSoup
import csv
import pandas as pd
import numpy as np
```
## 1. Main page
### Extracting Movie title, url, rank and rating of movies on the page
```
site = "http://www.imdb.com/chart/moviemeter?ref_=nv_mv_mpm_8"
hdr = {'User-Age... | github_jupyter |
## Coding Basics for Researchers - Day 1
*Notebook by [Pedro V Hernandez Serrano](https://github.com/pedrohserrano)*
---
# 2. Pandas Fundamentals
* [2.1. Dealing with different data sources](#2.1)
* [2.2. Data structures](#2.2)
---

## A research use case
#### Insurgency-Civilian Relations... | github_jupyter |
<a name="top"></a><img src="images/chisel_1024.png" alt="Chisel logo" style="width:480px;" />
# Module 2.5: Putting it all Together: An FIR Filter
**Prev: [Sequential Logic](2.4_sequential_logic.ipynb)**<br>
**Next: [Generators: Parameters](3.1_parameters.ipynb)**
## Motivation
Now that you've learned the basics of C... | github_jupyter |
RUN002 - Save result in Big Data Cluster
========================================
Description
-----------
This notebook saves results (metrics and the .ipynb/.html output) to the
Big Data Cluster (that is currently logged in to).
### Parameters
```
import os
import getpass
import datetime
app_name = "app-" + getpa... | github_jupyter |
# Flask API
## How Flask works
When we open a browser we see a few things:
Front-End
- **HTML** displays the page elements like the actual text on the website
- **CSS** styles the elemtns liek change font or sizeof the text
- **Bootstrap** provides some automatic styling through CSS and Javascript
Every website will... | github_jupyter |
```
model_name = "EfficientNetB5_224_regression"
import pandas as pd
import numpy as np
from sklearn.model_selection import StratifiedKFold, train_test_split
import math
import cv2
from sklearn.metrics import cohen_kappa_score
import matplotlib.pyplot as plt
import gc
from tqdm import tqdm
import os
import scipy as... | github_jupyter |
<h1> Create TensorFlow DNN model </h1>
This notebook illustrates:
<ol>
<li> Creating a model using the high-level Estimator API
</ol>
```
# change these to try this notebook out
BUCKET = 'cloud-training-demos-ml'
PROJECT = 'cloud-training-demos'
REGION = 'us-central1'
import os
os.environ['BUCKET'] = BUCKET
os.envir... | github_jupyter |
# Converting CKG to Sample and Data Relationship Format for Proteomics (SDRF-Proteomics)
## Abstract
Metadata is essential in proteomics data repositories and is crucial to interpret and reanalyze the deposited data sets. For every proteomics data set, we should capture at least three levels of metadata: (i) data set... | github_jupyter |
# Residual Networks
Welcome to the second assignment of this week! You will learn how to build very deep convolutional networks, using Residual Networks (ResNets). In theory, very deep networks can represent very complex functions; but in practice, they are hard to train. Residual Networks, introduced by [He et al.](h... | github_jupyter |
# Tying it all together
As François Chollet recommends in his excellent book, [Deep Learning with Python](https://www.manning.com/books/deep-learning-with-python), it is always a good idea to follow a general workflow.
This is why I adapt the workflow that is introduced in chapter 6.3.
Additionally, I am querying ... | github_jupyter |
```
import os
import sys
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
%matplotlib inline
from sklearn import linear_model
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error
from sklearn.tree import DecisionTreeR... | github_jupyter |
<h1>CS4619: Artificial Intelligence II</h1>
<h1>Recommender Systems IV</h1>
<h2>
Derek Bridge<br />
School of Computer Science and Information Technology<br />
University College Cork
</h2>
$\newcommand{\Set}[1]{\{#1\}}$
$\newcommand{\Tuple}[1]{\langle#1\rangle}$
$\newcommand{\v}[1]{\pmb{#1}}$
$\newcomma... | github_jupyter |
## Binomial distribution
#### https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.binom.html
#### Q1) For the random variable below that follows a binomial distribution corresponding to the given number of trials n, and probability of success p, find the probability of seeing x successes
a) n = 12, p = ... | github_jupyter |
* The empty ipynb for you to start from in the repo: https://github.com/grantmlong/itds2019
# Setting the stage
```
import sys
sys.version # 3.6
# if running on colab, pytorch is already installed.
# if running locally, conda or pip install this in your conda environment:
# conda install pytorch torchvision -c pytorc... | github_jupyter |
## 4.8 Using Ambiguous Grammars
### 4.8.1
> The following is an ambiguous grammar for expressions with $n$ binary, infix operators, at $n$ different levels of precedencce:
> $
E~\rightarrow~E~\theta_1~E~|~E~\theta_2~E~|~\cdots~|~E~\theta_n~E~|~(~E~)~|~\mathbf{id}
$
> a) As a function of $n$, what are the SLR sets o... | github_jupyter |
<IMG SRC="https://avatars2.githubusercontent.com/u/31697400?s=400&u=a5a6fc31ec93c07853dd53835936fd90c44f7483&v=4" WIDTH=125 ALIGN="right">
# Resampling
Resampling data is a very common operation when building a Modflow model. Usually it is used to project data from one grid onto the other. There are many different ... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
train_df=pd.read_csv('data/train.csv')
test_df=pd.read_csv('data/test.csv')
# train_df.sample(5)
# test_df.sample(5)
train_df.info()
# test_df.info()
```
带缺失值的列有:
**RentRoom、RentStatus、RentType、Region、BusLoc、SubwayLine、SubwaySta、SubwayDis、Remo... | github_jupyter |
```
#hide
#skip
! [ -e /content ] && pip install -Uqq fastai # upgrade fastai on colab
#export
from fastai.basics import *
#hide
from nbdev.showdoc import *
#default_exp callback.progress
```
# Progress and logging callbacks
> Callback and helper function to track progress of training or log results
```
from fastai... | github_jupyter |
# Chernoff Faces, Inception v3
Here we use the Inception v3 convolutional neural network (CNN) to classify Chernoff faces. We will judge its performance with the receiver operating characteristic (ROC) and precision-recall (PR) curves.
## Training and validation
Below is boilerplate code to learn from data.
```
im... | github_jupyter |
```
import pandas as pd
from pathlib import Path
from sklearn.pipeline import make_pipeline
from yellowbrick.model_selection import LearningCurve
from yellowbrick.regressor import ResidualsPlot
from yellowbrick.regressor import PredictionError
from sklearn.linear_model import LinearRegression
from sklearn.linear_model... | github_jupyter |
```
import qiskit
import numpy as np
import matplotlib.pyplot as plt
import sys
sys.path.insert(1, '../')
import qtm.base, qtm.constant, qtm.nqubit, qtm.fubini_study, qtm.progress_bar
import importlib
importlib.reload(qtm.base)
```
### GHZ
```
num_qubits = 3
num_layers = 2
thetas = np.ones(num_qubits*num_layers*5)
th... | github_jupyter |
# Keeping Track of x and y (solution)
This notebook contains solution code for the previous exercise.
```
import numpy as np
from math import pi
from matplotlib import pyplot as plt
# these 2 lines just hide some warning messages.
import warnings
warnings.filterwarnings('ignore')
class Vehicle:
def __init__(self... | github_jupyter |
##### Copyright 2021 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 |
# SLU14 - k-Nearest Neighbours (kNN)
In this notebook we will be covering the following:
- k-Nearest Neighbours Algorithm
- A Primer on Distance
- Some considerations about kNN
- Using kNN
## 1. k-Nearest Neighbours Algorithm
k-Nearest Neighbours (or kNN) is a supervised learning algorithm, that can be used both fo... | github_jupyter |
<a href="https://colab.research.google.com/github/cxbxmxcx/Evolutionary-Deep-Learning/blob/main/EDL_5_DE_HPO.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Setup
```
#@title Install DEAP
!pip install deap --quiet
#@title Defining Imports
#numpy
... | github_jupyter |
# Supervised sentiment: overview of the Stanford Sentiment Treebank
```
__author__ = "Christopher Potts"
__version__ = "CS224u, Stanford, Spring 2020"
```
## Contents
1. [Overview of this unit](#Overview-of-this-unit)
1. [Paths through the material](#Paths-through-the-material)
1. [Overview of this notebook](#Overvi... | github_jupyter |
<a href="https://colab.research.google.com/github/NeuromatchAcademy/course-content/blob/master/tutorials/W1D1_ModelTypes/W1D1_Intro.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Intro
**Our 2021 Sponsors, including Presenting Sponsor Facebook R... | github_jupyter |
## Exercise 2
In the course you learned how to do classificaiton using Fashion MNIST, a data set containing items of clothing. There's another, similar dataset called MNIST which has items of handwriting -- the digits 0 through 9.
Write an MNIST classifier that trains to 99% accuracy or above, and does it without a fi... | github_jupyter |
# Using model options in PyBaMM
In this notebook we show how to pass options to models. This allows users to do things such as include extra physics (e.g. thermal effects) or change the macroscopic dimension of the problem (e.g. change from a 1D model to a 2+1D pouch cell model). To see all of the options currently ava... | github_jupyter |
## Problem Statement
Given a linked list, swap the two nodes present at position `i` and `j`, assuming `0 <= i <= j`. The positions are based on 0-based indexing.
**Note:** You have to swap the nodes and not just the values.
**Example:**
* `linked_list = 3 4 5 2 6 1 9`
* `positions = 2 5`
* `output = 3 4 1 2 6 5 9`... | github_jupyter |
# Preprocessing of TAC-based Relation Extraction dataset
This notebook shows how to preprocess data in CONLL format, which is quite popular for storing the NLP datasets, for Knodle framework.
To show how it works, we have taken a relation extraction dataset based on TAC KBP corpora (Surdenau (2013)), also used in Rot... | github_jupyter |
```
from pathlib import Path
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from collections import OrderedDict
data_path = Path('../data')
!ls $data_path
def open_sets(base_path):
sets = {}
for path in base_path.glob('stability_*.csv'):
fname = path.stem
kind = fname... | github_jupyter |
### French English.
In this notebook we are going to create an `Encoder-Decoder` model that will learn to translate text from one domain to the other. We are going to create a model that translates sentences from French to English. The dataset that we will be using can be found [here](http://www.manythings.org/anki/)
... | github_jupyter |
# Training Neural Networks
The network we built in the previous part isn't so smart, it doesn't know anything about our handwritten digits. Neural networks with non-linear activations work like universal function approximators. There is some function that maps your input to the output. For example, images of handwritt... | github_jupyter |
```
#import standard libraries
import numpy as np
import matplotlib.pyplot as plt
import tidynamics as td
from scipy.optimize import curve_fit
from scipy.integrate import cumtrapz
import matplotlib
matplotlib.rcParams['xtick.labelsize']=20
matplotlib.rcParams['ytick.labelsize']=20
matplotlib.rcParams['font.size']=15
... | github_jupyter |
# Uniaxial tension of plate with elliptical hole
## Import packages
```
import numpy as np
import torch
import torch.nn as nn
import matplotlib.pyplot as plt
from matplotlib import cm
from mpl_toolkits.mplot3d import Axes3D
```
## User defined neural network
* A fully-connected feed-forward network
* **n_input*... | github_jupyter |
```
import numpy as np
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
from utils import show_graph
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
def train():
update_ops = tf.get_collection(tf.GraphKeys.UPDATE_OPS)
with tf.control_dependencies(update_ops):
... | github_jupyter |
# Dependencies
```
import os, warnings, shutil, re
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from transformers import AutoTokenizer
from sklearn.utils import shuffle
from sklearn.model_selection import StratifiedKFold
SEED = 0
warnings.filterwarnings("ignore")
pd.se... | github_jupyter |
# Introducing Pandas Data Structure
At the very basic level, Pandas objects can be thought of as enhanced versions of NumPy structured arrays in which the rows and columns are identified with labels rather than simple integer indices.
As we will see during the course of this chapter, Pandas provides a host of useful t... | github_jupyter |
<h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc"><ul class="toc-item"><li><span><a href="#msticpy---Event-Clustering" data-toc-modified-id="msticpy---Event-Clustering-1">msticpy - Event Clustering</a></span></li><li><span><a href="#Processes-on-Host---Clustering" data-toc-modified-id="Processes-... | github_jupyter |
# PDS federated API demo, Osiris-Rex OVIRS data visualization
# PART 2: FIND DATA YOU ARE INTERESTED IN
The purpose of this notebook is to demostrate how the PDS web API can be used to access the PDS data for a scientific use case.
The documention of the PDS web API is available on https://nasa-pds.github.io/pds-api/... | github_jupyter |
# Custom networks
Observational data is often extremely complex and high dimensional. `swyft` is designed to share the processing of observational data before passing it to each marginal classifier for marginal likelihood-to-evidence ratio estimation. This can be a combination of learnable transformations along with s... | github_jupyter |
# Retrieve & Re-Rank Demo over Simple Wikipedia
This examples demonstrates the Retrieve & Re-Rank Setup and allows to search over [Simple Wikipedia](https://simple.wikipedia.org/wiki/Main_Page).
You can input a query or a question. The script then uses semantic search
to find relevant passages in Simple English Wikip... | github_jupyter |
```
import sys, os
import geopandas as gpd
import glob2
import os
import io
import zipfile
import pandas as pd
from shapely.geometry import Point, LineString, MultiLineString
from scipy import spatial
from functools import partial
import pyproj
from shapely.ops import transform
import re
from shapely.wkt import loads
`... | github_jupyter |
# Install Rapids First
- Note use only T4 or P100 Or P4 GPU which is compatible for RAPIDS.
```
!nvidia-smi
! cat /proc/cpuinfo
# Install RAPIDS
!git clone https://github.com/rapidsai/rapidsai-csp-utils.git
!bash rapidsai-csp-utils/colab/rapids-colab.sh
import sys, os
dist_package_index = sys.path.index('/usr/local... | github_jupyter |
```
#!/usr/bin/env python
# coding: utf-8
import codecs
from datetime import datetime as dt
import json
import sys
import numpy as np
import os
import pandas as pd
import plotly
from plotly import subplots
import plotly.express as px
import plotly.tools as tls
import plotly.graph_objects as go
import plotly.io as pio
i... | github_jupyter |
# <div align="center">Logistic regression: Prove that the cost function is convex</div>
---------------------------------------------------------------------
you can Find me on Github:
> ###### [ GitHub](https://github.com/lev1khachatryan)
For logistic regression, focusing on binary classification here, we have c... | github_jupyter |
---
## **Chapter 1 - The way of the program**
Name: **Ajeet**
Collaborators: None
Time spent:
---
### Question 1
Write an English sentence with understandable semantics but incorrect syntax. Write another English sentence which has correct syntax but has semantic errors.
### Answer
- Understandable semantics ... | github_jupyter |
<h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc"><ul class="toc-item"><li><span><a href="#Dataset" data-toc-modified-id="Dataset-1"><span class="toc-item-num">1 </span>Dataset</a></span></li><li><span><a href="#Numerical-Model" data-toc-modified-id="Numerical-Model-2"><span class="toc... | github_jupyter |
# Día 02: Tipos de variables
### Objetivo: Conocer los distintos tipos de variables en python y sus usos
1. Enteros y dobles
1. Cadenas
1. Booleanos
1. Tuplas
1. Listas
1. Iterables
1. Diccionarios
1. Uso simple de print()
¿Qué es una variable?
En programación, una variable es un espacio reservado en la memoria de... | github_jupyter |
You might need to install this on your system:
apt-get install python3-opencv git
```
import os
#"""
# !rm k -r
if not os.path.isdir('k'):
!git clone -b development12 https://github.com/joaopauloschuler/k-neural-api.git k
else:
!cd k && git pull
#"""
!cd k && pip install .
import cai.layers
import cai.datasets
impo... | github_jupyter |
# Analyzing the UncertaintyForest Class by Reproducing Mutual Information Estimates
If you haven't seen it already, take a look at other tutorials to setup and install the ProgLearn package: `installation_guide.ipynb`.
*Goal: Run the UncertaintyForest class to produce a figure that compares estimated normalized mutua... | github_jupyter |
<a href="https://colab.research.google.com/github/TeachingUndergradsCHC/modules/blob/master/Programming/cuda/cudaBlur.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
This notebook will set up colab so that you can run the CUDA blur lab for the modul... | github_jupyter |
We will predict the condition of a hydraulic rig, based on the sensor data provided by the following sensors:
Pressure (5)
Motor power (1)
Volume flow (2)
temperature (4)
Vibration (1)
Colling efficiency (virtual) (1)
Cooling power (virtual) (1)
Efficiency factor (1)
Following is the information about the data set for... | github_jupyter |
<h3>P1 - Python If-Else</h3>
<i>
Given an integer, $n$, perform the following conditional actions:
* If $n$ is odd, print Weird
* If $n$ is even and in the inclusive range of $2$ to $5$, print Not Weird
* If $n$ is even and in the inclusive range of $6$ to $20$, print Weird
* If $n$ is even and greater than $20$, pri... | github_jupyter |
# Convolutional Variational Autoencoder
This Tutorial is Based on [Tensorflow Tutorials](https://www.tensorflow.org/tutorials)
This notebook demonstrates how train a Variational Autoencoder (VAE) ([1](https://arxiv.org/abs/1312.6114), [2](https://arxiv.org/abs/1401.4082)). on the MNIST dataset. A VAE is a probabilist... | github_jupyter |
# Fast-Free Time-Resolved Electrostatic Force Microscopy (FF-trEFM)
### Rajiv Giridharagopal, Ph.D.
#### rgiri@uw.edu
Department of Chemistry
University of Washington
Box 351700
Seattle, Washington, USA 98195
* [Github link](https://github.com/rajgiriUW/ffta)
* [Documentation (in progress)](https://ffta.readt... | github_jupyter |
<a href="https://www.nvidia.com/en-us/deep-learning-ai/education/"> <img src="images/DLI Header.png" alt="Header" style="width: 400px;"/> </a>
# Expose a network to data
Your instructions will live in this notebook, and your workspace will be in DIGITS. You'll need to go back and forth between the two tabs. Open DIGI... | github_jupyter |
# CSX46 - Class Session 4 - Transitivity (Clustering Coefficients)
In this class session we are going to compute the local clustering coefficient of all vertices in the undirected human
protein-protein interaction network (PPI), in two ways -- first without using `igraph`, and the using `igraph`. We'll obtain the inte... | github_jupyter |
### **This notebook is used to generate segmentation results in relation to each of the four modality individually**
```
from google.colab import drive
drive.mount('/content/drive')
pip install nilearn
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import tensorflow as tf
from sklearn.model_sel... | github_jupyter |
# Lecture 22: Cost Functions
## Load Packages
```
%matplotlib inline
import torch
import numpy as np
import torchvision
import torch.nn as nn
import torch.optim as optim
import matplotlib.pyplot as plt
import torch.nn.functional as F
from torchvision import datasets, transforms
from skimage.measure import compare_ssi... | github_jupyter |
# Direct Marketing with Amazon SageMaker Autopilot
---
---
## Contents
1. [Introduction](#Introduction)
1. [Prerequisites](#Prerequisites)
1. [Downloading the dataset](#Downloading)
1. [Upload the dataset to Amazon S3](#Uploading)
1. [Setting up the SageMaker Autopilot Job](#Settingup)
1. [Launching the SageMaker Au... | github_jupyter |
```
# First goal: be able to handcraft a hash including padding
from hashlib import md5
import os
nonce = os.urandom(16)
nonce = b'N\xcf\xbbG\x0eH\x12\x1e\\k\xbbRc\x17\xe3\x18'
user_nonce = b'a' # b"abcdefgh"
pad = padding(len((nonce+user_nonce)*8))
odds = 112
result = int(md5(nonce + user_nonce).hexdigest(),16) & ((... | github_jupyter |
```
# Remember: library imports are ALWAYS at the top of the script, no exceptions!
import sqlite3
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from math import ceil
# for better resolution plots
%config InlineBackend.figure_format = 'retina' # optionally, you ... | github_jupyter |
# Classification de genres musicaux
Lionel Baptiste, Ghali El Ouarzazi, Joévin Soulenq
Basé sur les travaux de Michaël Defferrard : https://github.com/mdeff/fma
## Comparaison des performances des classifieurs
* apprentissage des données sur 7 différents classifieurs
* affiche la précision
* affiche le temps d'exéc... | github_jupyter |
Disclosure: this is taken from https://kaggle.com/zaharch/keras-model-boosted-with-plates-leak
As reported by Recursion [in this post](https://www.kaggle.com/c/recursion-cellular-image-classification/discussion/102905), there is a special structure in the data which simplifies predictions significantly.
Assignments ... | github_jupyter |
# Multiple Qubits & Entangled States
Single qubits are interesting, but individually they offer no computational advantage. We will now look at how we represent multiple qubits, and how these qubits can interact with each other. We have seen how we can represent the state of a qubit using a 2D-vector, now we will see ... | github_jupyter |
How to run a simple N-body code
====================
Here we will generate initial conditions for an N-body code, run a small simulation and analyse the results. This analysis is performed on a 100 star cluster in a 1 pc virial-radius King model. Stellar masses are taken randomly from a Salpeter distribution.
Stellar ... | github_jupyter |
```
from numpy.random import seed
from numpy.random import randn
from numpy import mean
from numpy import std
seed(1)
data1 = 5 * randn(100) + 50
data2 = 5 * randn(100) + 51
print('data1: mean=%.3f stdv=%.3f' % (mean(data1), std(data1)))
print('data2: mean=%.3f stdv=%.3f' % (mean(data2), std(data2)))
```
* As it ca... | github_jupyter |
# Basics
_Jenny Kim, Phil Marshall_
In this notebook we demonstrate some of the basic functionality of the `SLRealizer` class, including:
* Reading in an `OM10` mock lens catalog and selecting a subsample of lenses to work on.
* Reading in an observation history, and setting up a list of `LensSystem` objects.
* Vi... | github_jupyter |
# Custom Training Basics
In this ungraded lab you'll gain a basic understanding of building custom training loops.
- It takes you through the underlying logic of fitting any model to a set of inputs and outputs.
- You will be training your model on the linear equation for a straight line, wx + b.
- You will impleme... | github_jupyter |
```
!pip install autokeras
import pandas as pd
import tensorflow as tf
import autokeras as ak
```
To make this tutorial easy to follow, we use the UCI Airquality dataset, and try to
forecast the AH value at the different timesteps. Some basic preprocessing has also
been performed on the dataset as it required cleanup... | github_jupyter |
# SciPy
SciPy is a collection of mathematical algorithms and convenience functions built on the Numpy extension of Python. It adds significant power to the interactive Python session by providing the user with high-level commands and classes for manipulating and visualizing data. With SciPy an interactive Python sessi... | github_jupyter |
<table class="ee-notebook-buttons" align="left">
<td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Algorithms/CloudMasking/modis_surface_reflectance_qa_band.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td... | github_jupyter |
```
# !wget https://f000.backblazeb2.com/file/malay-dataset/qa/natural/translated-train.json
# !wget https://f000.backblazeb2.com/file/malay-dataset/qa/natural/translated-validation.json
files = ['translated-train.json', 'translated-validation.json']
import re
def cleaning(string):
string = string.replace('\n', ' ... | github_jupyter |
# Part III - A: Analyzing Changing Trends in Academia - Paper Trends
# 0. Setup
Before we begin, make sure you have installed all the additional required Python packages. (The instructions below use pip. You can use easy_install, too.) Also, consider using virtualenv for a cleaner installation experience instead of s... | github_jupyter |
# Accessing cloud satellite data
- Funding: Interagency Implementation and Advanced Concepts Team [IMPACT](https://earthdata.nasa.gov/esds/impact) for the Earth Science Data Systems (ESDS) program and AWS Public Dataset Program
### Credits: Tutorial development
* [Dr. Chelle Gentemann](mailto:gentemann@faralloninst... | github_jupyter |
<h1>Testing the E2E simulations - initial try</h1>
This was done before I had developped the `SegmentedTelescopeAPLC` class.
## -- ATLAST aperture --
This script introduces the end-to-end (E2E) simulations that are used in **`calibration.py`**, for the influence calibration of each individual segment. The testing of... | github_jupyter |
# Test `tracer_thalweg_and_surface` Module
Render figure object produced by the `nowcast.figures.research.tracer_thalweg_and_surface` module.
Set-up and function call replicates as nearly as possible what is done in the `nowcast.workers.make_plots` worker
to help ensure that the module will work in the nowcast produc... | github_jupyter |
# Home assignment #2. Particle filter
In this homework assignment, we will implement an algorithm for estimating the robot's pose known as a particle filter.
A particle filter consists of the following steps:
1. The movement of particles in accordance with the kinematic motion model. The movement is carried out using... | github_jupyter |
# Введение в pytorch
**Разработчик: Алексей Озерин**
# Устанавливаем pytorch
## Linux/Mac/Windows
На оффсайте http://pytorch.org/ надо выбрать подходящую конфигурацию и установить пакеты pytorch (версия 1.6) и соответствующий torchvision.
Версию python можно узнать в терминале:
```
python --version
```
```
impor... | github_jupyter |
# TensorFlow Datasets
TFDS provides a collection of ready-to-use datasets for use with TensorFlow, Jax, and other Machine Learning frameworks.
It handles downloading and preparing the data deterministically and constructing a `tf.data.Dataset` (or `np.array`).
Note: Do not confuse [TFDS](https://www.tensorflow.org/d... | github_jupyter |
# CX 4230, Spring 2016: [36] Dynamical systems on networks
This lab accompanies the slides from the last class: https://t-square.gatech.edu/access/content/group/gtc-59b8-dc03-5a67-a5f4-88b8e4d5b69a/cx4230-sp16--34--dyn-sys-nets.pdf
## A conceptual model of "opinion dynamics"
To illustrate the interesting dynamics po... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
import torch
from UnarySim.sw.metric.metric import NormStability, NSbuilder, Stability, ProgressiveError
from UnarySim.sw.stream.gen import RNG, SourceGen, BSGen
from UnarySim.sw.kernel.tanh import tanhP1
import random
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d impo... | github_jupyter |
# Lecture 2: Integral equations/quadratures
## Previous lecture
- Intro
- IE for external problems
## Todays lecture
- IE discretization
- Nystrom, collocation, Galerkin method
## Simplest integral equation
The simplest integral equation we talked about reads
$$\int_{\partial \Omega} \frac{q(y)}{\Vert x - y \Vert}... | github_jupyter |
```
import json
import time
import os
import requests
import fml_manager
from fml_manager import *
manager = fml_manager.FMLManager()
```
## For more details about the FMLManager, please refer to this [document](https://kubefate.readthedocs.io/README.html)
```
response = manager.load_data(url='./data/breast_b.csv',... | github_jupyter |
##### Copyright 2021 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 |
### 1. Importing necessory libraries
```
import numpy as np
import pandas as pd
# text processing libraries
import re
import string
import nltk
from nltk.corpus import stopwords
# sklearn
from sklearn import model_selection
from sklearn.feature_extraction.text import CountVectorizer,TfidfVectorizer
from sklearn.l... | github_jupyter |
```
# !pip install fake_useragent
# !pip install -U fake_useragent
import requests
from fake_useragent import UserAgent
import json
from hashlib import md5
import pprint
import time, random
from urllib.request import urlretrieve
from os import listdir
import re
urlretrieve("http://img.xiami.net/lyric/93/1797984893_1511... | github_jupyter |
```
import re
import jieba
import sys
import matplotlib
from nltk import *
from matplotlib import rcParams
from matplotlib.font_manager import findfont, FontProperties, _rebuild
from universalMethod import *
# 读取文本信息
def readFile(path):
str_doc = ""
with open(path, 'r', encoding='utf-8') as f:
str_doc ... | github_jupyter |
# Train the model to colorize images.
#Put images in a certain directory.
## Prepare 6 train images and test images.
```
path = '/content/img'
train_datagen = ImageDataGenerator(rescale=1. / 255)
import glob
import PIL
from PIL import Image
train_img = []
train_dir = r'/content/img'
for im in glob.glob(train_dir+'/*... | github_jupyter |
# The Devito domain specific language: an overview
This notebook presents an overview of the Devito symbolic language, used to express and discretise operators, in particular partial differential equations (PDEs).
For convenience, we import all Devito modules:
```
from devito import *
```
## From equations to code ... | github_jupyter |
## Tutorial 104: Generate 21 ADME Predictors with 10 Lines of Code
[Kexin](https://twitter.com/KexinHuang5)
In the previous set of tutorials, hopefully, you are now familiarized with TDC. In this tutorial, we show through examples how to use TDC for fast ML model prototyping using DeepPurpose. Let's start introducing... | github_jupyter |
#Introduction to Lea
```
from lea import *
# mandatory die example - initilize a die object
die = Lea.fromVals(1, 2, 3, 4, 5, 6)
# throw the die a few times
die.random(20)
# mandatory coin toss example - states can be strings!
coin = Lea.fromVals('Head', 'Tail')
# toss the coin a few times
coin.random(10)
# how about ... | github_jupyter |
<a href="https://colab.research.google.com/github/Magikis/project-deep-learning/blob/master/ProjectDeepLearning_pytorchCIFAR.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
import torch
import torchvision
import torchvision.transforms as transfo... | github_jupyter |
Copyright (c) 2021 Robert Bosch GmbH
All rights reserved.
This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
@author: [Barbara Rakitsch](mailto:barbara.rakitsch@de.bosch.com)
# Hybrid Modeling Tutorial
<img src="assets/img/schema.png" style="wid... | github_jupyter |
<h1>CS4618: Artificial Intelligence I</h1>
<h1>Overfitting and Underfitting</h1>
<h2>
Derek Bridge<br>
School of Computer Science and Information Technology<br>
University College Cork
</h2>
<h1>Initialization</h1>
$\newcommand{\Set}[1]{\{#1\}}$
$\newcommand{\Tuple}[1]{\langle#1\rangle}$
$\newcommand{\v}... | github_jupyter |
```
import sys
import importlib
import os
import boto3
import json
from sagemaker import get_execution_role
from sagemaker.tensorflow import TensorFlow
from datetime import datetime
import os
import pprint
import subprocess
# Login to ECR and select training image
region = "us-west-2"
set_region = f"aws configure set r... | github_jupyter |
# Lab 07 - Uncertainty Quantification
## Tasks
- Train different machine learning algorithms on noisy data
- Predict the uncertainty from the trained model
## Set up environment
```
!pip install git+https://github.com/uspas/2021_optimization_and_ml --quiet
!pip install blitz-bayesian-pytorch --quiet
%reset -f
impo... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.