code stringlengths 2.5k 836k | kind stringclasses 2
values | parsed_code stringlengths 2 404k | quality_prob float64 0.6 0.98 | learning_prob float64 0.3 1 |
|---|---|---|---|---|
# Visualizing Logistic Regression
```
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('data/', one_hot=True)
trainimg = mnist.train.images
trainlabel = mnist.train.labels
testimg = mnist.te... | github_jupyter | import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('data/', one_hot=True)
trainimg = mnist.train.images
trainlabel = mnist.train.labels
testimg = mnist.test.images
testlabel = mnist.test.label... | 0.676086 | 0.913252 |
# Final Project Submission
* Student name: `Reno Vieira Neto`
* Student pace: `self paced`
* Scheduled project review date/time: `Fri Oct 15, 2021 3pm – 3:45pm (PDT)`
* Instructor name: `James Irving`
* Blog post URL: https://renoneto.github.io/using_streamlit
#### This project originated the [following app](https://... | github_jupyter | import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import re
import time
from surprise import Reader, Dataset, dump
from surprise.model_selection import cross_validate, GridSearchCV
from surprise.prediction_algorithms import KNNBasic, KNNBaseline, SVD, SVDpp
from surprise.accur... | 0.662906 | 0.885829 |
```
#all_slow
#export
from fastai.basics import *
#hide
from nbdev.showdoc import *
#default_exp callback.tensorboard
```
# Tensorboard
> Integration with [tensorboard](https://www.tensorflow.org/tensorboard)
First thing first, you need to install tensorboard with
```
pip install tensorboard
```
Then launch tensorbo... | github_jupyter | #all_slow
#export
from fastai.basics import *
#hide
from nbdev.showdoc import *
#default_exp callback.tensorboard
pip install tensorboard
in your terminal. You can change the logdir as long as it matches the `log_dir` you pass to `TensorBoardCallback` (default is `runs` in the working directory).
## Tensorboard Embe... | 0.718496 | 0.86511 |
<a href="https://colab.research.google.com/github/Victoooooor/SimpleJobs/blob/main/movenet.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
#@title
!pip install -q imageio
!pip install -q opencv-python
!pip install -q git+https://github.com/tenso... | github_jupyter | #@title
!pip install -q imageio
!pip install -q opencv-python
!pip install -q git+https://github.com/tensorflow/docs
#@title
import tensorflow as tf
import tensorflow_hub as hub
from tensorflow_docs.vis import embed
import numpy as np
import cv2
import os
# Import matplotlib libraries
from matplotlib import pyplot as p... | 0.760651 | 0.820001 |
# Getting started with Captum Insights: a simple model on CIFAR10 dataset
Demonstrates how to use Captum Insights embedded in a notebook to debug a CIFAR model and test samples. This is a slight modification of the CIFAR_TorchVision_Interpret notebook.
More details about the model can be found here: https://pytorch.o... | github_jupyter | import os
import torch
import torch.nn as nn
import torchvision
import torchvision.transforms as transforms
from captum.insights import AttributionVisualizer, Batch
from captum.insights.features import ImageFeature
def get_classes():
classes = [
"Plane",
"Car",
"Bird",
"Cat",
... | 0.905044 | 0.978935 |
# Loading Image Data
So far we've been working with fairly artificial datasets that you wouldn't typically be using in real projects. Instead, you'll likely be dealing with full-sized images like you'd get from smart phone cameras. In this notebook, we'll look at how to load images and use them to train neural network... | github_jupyter | %matplotlib inline
%config InlineBackend.figure_format = 'retina'
import matplotlib.pyplot as plt
import torch
from torchvision import datasets, transforms
import helper
dataset = datasets.ImageFolder('path/to/data', transform=transform)
root/dog/xxx.png
root/dog/xxy.png
root/dog/xxz.png
root/cat/123.png
root/cat... | 0.829561 | 0.991161 |
```
# Visualization of the KO+ChIP Gold Standard from:
# Miraldi et al. (2018) "Leveraging chromatin accessibility for transcriptional regulatory network inference in Th17 Cells"
# TO START: In the menu above, choose "Cell" --> "Run All", and network + heatmap will load
# Change "canvas" to "SVG" (drop-down menu in ce... | github_jupyter | # Visualization of the KO+ChIP Gold Standard from:
# Miraldi et al. (2018) "Leveraging chromatin accessibility for transcriptional regulatory network inference in Th17 Cells"
# TO START: In the menu above, choose "Cell" --> "Run All", and network + heatmap will load
# Change "canvas" to "SVG" (drop-down menu in cell b... | 0.609757 | 0.747455 |
# Bagging
This notebook introduces a very natural strategy to build ensembles of
machine learning models named "bagging".
"Bagging" stands for Bootstrap AGGregatING. It uses bootstrap resampling
(random sampling with replacement) to learn several models on random
variations of the training set. At predict time, the p... | github_jupyter | import pandas as pd
import numpy as np
# create a random number generator that will be used to set the randomness
rng = np.random.RandomState(1)
def generate_data(n_samples=30):
"""Generate synthetic dataset. Returns `data_train`, `data_test`,
`target_train`."""
x_min, x_max = -3, 3
x = rng.uniform(x... | 0.856317 | 0.963057 |
### Dependencies for the interactive plots apart from rdkit, oechem and other qc* packages
!conda install -c conda-forge plotly -y
!conda install -c plotly jupyter-dash -y
!conda install -c plotly plotly-orca -y
```
#imports
import numpy as np
from scipy import stats
import fragmenter
from openeye import oechem... | github_jupyter | #imports
import numpy as np
from scipy import stats
import fragmenter
from openeye import oechem
TD_datasets = [
'Fragment Stability Benchmark',
# 'Fragmenter paper',
# 'OpenFF DANCE 1 eMolecules t142 v1.0',
'OpenFF Fragmenter Validation 1.0',
'OpenFF Full TorsionDrive Benchmark 1',
'OpenFF Gen 2 Torsion Set ... | 0.668015 | 0.692207 |
# Noisy Convolutional Neural Network Example
Build a noisy convolutional neural network with TensorFlow v2.
- Author: Gagandeep Singh
- Project: https://github.com/czgdp1807/noisy_weights
Experimental Details
- Datasets: The MNIST database of handwritten digits has been used for training and testing.
Observations
... | github_jupyter | from __future__ import absolute_import, division, print_function
import tensorflow as tf
from tensorflow.keras import Model, layers
import numpy as np
# MNIST dataset parameters.
num_classes = 10 # total classes (0-9 digits).
# Training parameters.
learning_rate = 0.001
training_steps = 200
batch_size = 128
display_s... | 0.939519 | 0.974893 |
This is a "Neural Network" toy example which implements the basic logical gates.
Here we don't use any method to train the NN model. We just guess correct weight.
It is meant to show how in principle NN works.
```
import math
def sigmoid(x):
return 1./(1+ math.exp(-x))
def neuron(inputs, weights):
return sigmo... | github_jupyter | import math
def sigmoid(x):
return 1./(1+ math.exp(-x))
def neuron(inputs, weights):
return sigmoid(sum([x*y for x,y in zip(inputs,weights)]))
def almost_equal(x,y,epsilon=0.001):
return abs(x-y) < epsilon
def NN_OR(x1,x2):
weights =[-10, 20, 20]
inputs = [1, x1, x2]
return neuron(weights,input... | 0.609292 | 0.978073 |
End of preview. Expand in Data Studio
- Downloads last month
- 44