Skip to content

Instantly share code, notes, and snippets.

View galeone's full-sized avatar

Paolo Galeone galeone

View GitHub Profile
@galeone
galeone / keybase.md
Created October 18, 2014 08:28
Keybase proof

Keybase proof

I hereby claim:

  • I am galeone on github.
  • I am nessuno (https://keybase.io/nessuno) on keybase.
  • I have a public key whose fingerprint is 72EF B984 8764 F75F 26F1 A853 C989 A5CF 984D 4E43

To claim this, I am signing this object:

@galeone
galeone / fix_tf_api.sh
Last active December 15, 2016 09:21
Replace in every python file the old Tensorflow API with the new syntax
#!/usr/bin/env bash
find . -name '*.py' -exec grep "tf.image_summary" {} -H \; | cut -d':' -f1 | xargs -l sed -i 's/tf\.image_summary/tf.summary.image/g'
find . -name '*.py' -exec grep "tf.audio_summary" {} -H \; | cut -d':' -f1 | xargs -l sed -i 's/tf\.audio_summary/tf.summary.audio/g'
find . -name '*.py' -exec grep "tf.histogram_summary" {} -H \; | cut -d':' -f1 | xargs -l sed -i 's/tf\.histogram_summary/tf.summary.histogram/g'
find . -name '*.py' -exec grep "max_images" {} -H \; | cut -d':' -f1 | xargs -l sed -i 's/max_images/max_outputs/g'
find . -name '*.py' -exec grep "tf.merge_summary" {} -H \; | cut -d':' -f1 | xargs -l sed -i 's/tf\.merge_summary/tf.summary.merge/g'
find . -name '*.py' -exec grep "tf.scalar_summary" {} -H \; | cut -d':' -f1 | xargs -l sed -i 's/tf\.scalar_summary/tf.summary.scalar/g'
find . -name '*.py' -exec grep "tf.initialize_all_variables" {} -H \; | cut -d':' -f1 | xargs -l sed -i 's/tf\.initialize_all_variables/tf.global_variables_initializer/g'
find . -name '*.py' -exec grep
@galeone
galeone / draw_binomial_distribution.py
Created January 10, 2017 15:32
Draw the probability of the binomial distribution, varying the probability
import matplotlib.pyplot as plt
from scipy.stats import binom
import numpy as np
# number of neurons
n = 1024
# number of tests (input examples)
size = 500
# histogram bin width, for data visualization
binwidth = 5
@galeone
galeone / PKGBUILD
Last active May 17, 2018 15:30
PKGBUILD for OpenCV 3.1.1 with CUDA 9 enabled
pkgname="opencv-cuda-stable"
_pkgname="opencv-stable"
pkgver=3.4.1
pkgrel=1
pkgdesc="Open Source Computer Vision Library compiled with extra modules(opencv_contrib) and CUDA"
url="http://opencv.org/"
license=('BSD')
arch=('i686' 'x86_64' 'armv7h' 'armv6h')
depends=('gst-plugins-base' 'openexr'
'xine-lib' 'libdc1394' 'gtkglext'
@galeone
galeone / SingleLayerCAE.py
Last active September 23, 2019 08:00
Single Layer Convolutional Auto Encoder
# import tensorflow
import tensorflow as tf
# import the utils file in the current folder
from . import utils
# from the Autoencoder file import the interface to implement
from .Autoencoder import Autoencoder
class SingleLayerCAE(Autoencoder):
""" Build a single layer CAE"""
@galeone
galeone / attempt3.go
Created May 29, 2017 18:58
Defining and executing a tensorflow graph in Go
package main
import (
"fmt"
tf "github.com/tensorflow/tensorflow/tensorflow/go"
"github.com/tensorflow/tensorflow/tensorflow/go/op"
)
func main() {
// Let's describe what we want: create the graph
@galeone
galeone / engine-coverage.patch
Created February 16, 2022 08:30
Enable code coverage support on Unreal Built Tool Linux Toolchain
--- a/Engine/Source/Programs/UnrealBuildTool/Configuration/ModuleRules.cs
+++ b/Engine/Source/Programs/UnrealBuildTool/Configuration/ModuleRules.cs
@@ -606,6 +606,10 @@ namespace UnrealBuildTool
{
get
{
+ if (bCodeCoverage) {
+ return CodeOptimization.Never;
+ }
+