Skip to content

Instantly share code, notes, and snippets.

View FrancescoSaverioZuppichini's full-sized avatar
🧸
Focusing

Francesco Saverio Zuppichini FrancescoSaverioZuppichini

🧸
Focusing
  • roboflow
  • Lugano, Switzerland
View GitHub Profile
@starhopp3r
starhopp3r / main.py
Last active September 25, 2017 07:55
import numpy as np
import os
class NeuralNetwork:
def __init__(self):
# Our training data
self.X = np.array([[0, 0, 1], [1, 1, 1], [1, 0, 1], [0, 1, 1]])
self.y = np.transpose(np.array([[0, 1, 1, 1]]))
# Seed random number generator to produce the same
@nicolasdespres
nicolasdespres / iter_shuffle_batch_tensors.py
Created March 8, 2017 08:12
Iterate of shuffled batch of tensors slices.
class iter_shuffle_batch_tensors(Iterator):
"""Combine `iter_tensors_slice` and `iter_shuffle_batch_range`.
Args:
See `iter_tensors_slice` and `iter_shuffle_batch_range`.
Output:
See `iter_shuffle_batch_range`.
"""
@iambrian
iambrian / OpenAI-Gym_setup.md
Last active November 13, 2020 21:12
OpenAI gym tutorial

Getting Setup: Follow the instruction on https://gym.openai.com/docs

git clone https://github.com/openai/gym
cd gym
pip install -e . # minimal install

Basic Example using CartPole-v0:

@Qwlouse
Qwlouse / lstm_reference.ipynb
Last active December 15, 2020 18:54
LSTM Reference Implementation in Python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@somada141
somada141 / vtk_texture_sphere.py
Last active February 22, 2021 13:29
How to apply a texture to a sphere in VTK #python #visualization #vtk
#!/usr/bin/env python
##
# This example shows how to apply an vtkImageData texture to an sphere
# vtkPolyData object.
# Note: Input jpg file can be located in the VTKData repository.
#
# @author JBallesteros
##
@dmmiller612
dmmiller612 / tensorflow_json.py
Created December 11, 2017 15:58
Tensorflow Graph and weights to json and back for training
import tensorflow as tf
import numpy as np
from google.protobuf import json_format
import json
np.random.seed(12345)
def tensorflow_get_weights():
"""
@kastnerkyle
kastnerkyle / painless_q.py
Last active August 18, 2023 09:32
Painless Q-Learning Tutorial implementation in Python http://mnemstudio.org/path-finding-q-learning-tutorial.htm
# Author: Kyle Kastner
# License: BSD 3-Clause
# Implementing http://mnemstudio.org/path-finding-q-learning-tutorial.htm
# Q-learning formula from http://sarvagyavaish.github.io/FlappyBirdRL/
# Visualization based on code from Gael Varoquaux gael.varoquaux@normalesup.org
# http://scikit-learn.org/stable/auto_examples/applications/plot_stock_market.html
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.collections import LineCollection
@baraldilorenzo
baraldilorenzo / readme.md
Last active November 21, 2023 22:41
VGG-16 pre-trained model for Keras

##VGG16 model for Keras

This is the Keras model of the 16-layer network used by the VGG team in the ILSVRC-2014 competition.

It has been obtained by directly converting the Caffe model provived by the authors.

Details about the network architecture can be found in the following arXiv paper:

Very Deep Convolutional Networks for Large-Scale Image Recognition

K. Simonyan, A. Zisserman

@morrolinux
morrolinux / linux-full-desktop-container.md
Last active January 30, 2024 14:21
Run a full linux desktop in a container

In the following gist I'm going to guide you through the process of installing and booting an entire linux distribution with full desktop environment just like you would have with a classical VM, but with much better performance and much worse isolation :)

The reason why I did this was mainly because it's cool, but also to test new distros with decent graphics performance without actually booting them on my PC.

If you "try this at home" just keep in mind a container is not as secure as a VM, and some of the option we're going to explore will weaken container isolation from "a bit risky" to "totally unsafe" depending on what you choose.

Also, we're going to use systemd-nspawn for containers as it's probably the best fit for our use case and can also boot any linux partition without needing to prepare an apposite container image.

Less go!

@peterroelants
peterroelants / mnist_estimator.py
Last active February 14, 2024 11:26
Example using TensorFlow Estimator, Experiment & Dataset on MNIST data.
"""Script to illustrate usage of tf.estimator.Estimator in TF v1.3"""
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data as mnist_data
from tensorflow.contrib import slim
from tensorflow.contrib.learn import ModeKeys
from tensorflow.contrib.learn import learn_runner
# Show debugging output