Skip to content

Instantly share code, notes, and snippets.

View malcolmgreaves's full-sized avatar

Malcolm Greaves malcolmgreaves

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@outofcoffee
outofcoffee / find-ecr-image.sh
Last active March 1, 2024 13:35
Check if Docker image exists with tag in AWS ECR
#!/usr/bin/env bash
# Example:
# ./find-ecr-image.sh foo/bar mytag
if [[ $# -lt 2 ]]; then
echo "Usage: $( basename $0 ) <repository-name> <image-tag>"
exit 1
fi
IMAGE_META="$( aws ecr describe-images --repository-name=$1 --image-ids=imageTag=$2 2> /dev/null )"
@malcolmgreaves
malcolmgreaves / val_max.scala
Last active February 23, 2018 04:20
Generic maximum function (max) with float-value-transforming typeclass (Val).
case class Scored[T](item: T, value: Double)
trait Val[-A] {
def valueOf(a: A): Double
}
object Val {
def apply[T: Val]: Val[T] =
implicitly[Val[T]]
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@santisbon
santisbon / Search my gists.md
Last active May 10, 2024 01:27
How to #search gists

Enter this in the search box along with your search terms:

Get all gists from the user santisbon.
user:santisbon

Find all gists with a .yml extension.
extension:yml

Find all gists with HTML files.
language:html

@smitshilu
smitshilu / Tensorflow_Build_GPU.md
Last active June 9, 2020 18:27
Tensorflow 1.4 Mac OS High Sierra 10.13 GPU Support

Tensorflow

System information

  • OS - High Sierra 10.13
  • Tensorflow - 1.4
  • Xcode command line tools - 8.2 (Download from here: Xcode - Support - Apple Developer & Switch to different clang version: sudo xcode-select --switch/Library/Developer/CommandLineTools & check version: clang -v)
  • Cmake - 3.7
  • Bazel - 0.7.0
@fchollet
fchollet / new_stacked_rnns.py
Last active August 13, 2019 15:23
New stacked RNNs in Keras
import keras
import numpy as np
timesteps = 60
input_dim = 64
samples = 10000
batch_size = 128
output_dim = 64
# Test data.
@venik
venik / build_tf.sh
Last active February 22, 2024 06:12
Bash script for local building TensorFlow on Mac/Linux with all CPU optimizations (default pip package has only SSE)
#!/usr/bin/env bash
# Author: Sasha Nikiforov
# source of inspiration
# https://stackoverflow.com/questions/41293077/how-to-compile-tensorflow-with-sse4-2-and-avx-instructions
# Detect platform
if [ "$(uname)" == "Darwin" ]; then
# MacOS
@eamartin
eamartin / notebook.ipynb
Last active November 6, 2022 18:53
Understanding & Visualizing Self-Normalizing Neural Networks
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@malcolmgreaves
malcolmgreaves / fold.py
Created June 29, 2017 00:25
Fold left and fold right for Python.
def foldl(zero, combine, elements):
if callable(zero):
result = zero()
else:
result = zero
for x in elements:
result = combine(result, x)
return result
def foldr(zero, combine, elements):