We're getting ripped off. No matter what, we need to do something about it.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Description: | |
Takes in a color image and creates a two CSV files storing downsized | |
matrix (grayscale) and 3-tensor representations of the image. | |
Instructions: | |
Put your image in the same folder as this file (tool4c.py), | |
then open a terminal in that folder and enter: | |
python tool4c <your_image> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from svgpathtools import * | |
# create some example paths | |
path1 = CubicBezier(1,2+3j,3-5j,4+1j) | |
path2 = path1.rotated(60).translated(3) | |
# find minimizer | |
from scipy.optimize import fminbound | |
def dist(t): | |
return path1.radialrange(path2.point(t))[0][0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""The goal of this gist is to show how to compute many points on a path | |
quickly using NumPy arrays. I.e. there's a much faster way than using, say | |
[some_path.point(t) for t in many_tvals]. The example below assumes the | |
`Path` object is composed entirely of `CubicBezier` objects, but this can | |
easily be generalized to paths containing `Line` and `QuadraticBezier` objects | |
also. | |
Note: The relevant matrix transformation for quadratics can be found in the | |
svgpathtools.bezier module.""" | |
import numpy as np |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Scrape the definition of a word (or phrase) from dictionary.com | |
Usage: | |
====== | |
python define.py onomatopoeia | |
Warning: | |
======== | |
Sometimes (at least with phrases) you'll be unexpectedly redirected | |
to the definition of another only loosely related word, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Downloads ArXiv papers linked to in a Google Doc converted to HTML. | |
Notes: | |
------ | |
* tested on OS X with Python 3 | |
* Requires arxiv (`pip install arxiv`) | |
* Names of PDFs will be the papers' titles on ArXiv (with some | |
slight formatting changes). | |
""" |
Building Tensorflow from source on Ubuntu 16.04LTS for maximum performance:
TensorFlow is now distributed under an Apache v2 open source license on GitHub.
On Ubuntu 16.04LTS+:
Step 1. Install NVIDIA CUDA:
To use TensorFlow with NVIDIA GPUs, the first step is to install the CUDA Toolkit as shown:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Implementation of RoI Pooling | |
Credit: This is from tutorial available at | |
https://medium.com/xplore-ai/992508b6592b | |
""" | |
import tensorflow as tf | |
from tensorflow.keras.layers import Layer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# probably about right | |
def variance(samples): | |
mean = sum(samples) / len(samples) | |
return sum((x - mean)**2 for x in samples) / len(samples) | |
# probably too short | |
def var(s): | |
m = sum(s) / len(s) | |
return sum((x - m)**2 for x in s) / len(s) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2015 The TensorFlow Authors. 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 applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
OlderNewer