Skip to content

Instantly share code, notes, and snippets.

View ptigas's full-sized avatar
🐙

Panagiotis Tigas ptigas

🐙
View GitHub Profile
@onlurking
onlurking / programming-as-theory-building.md
Last active April 19, 2024 22:31
Programming as Theory Building - Peter Naur

Programming as Theory Building

Peter Naur

Peter Naur's classic 1985 essay "Programming as Theory Building" argues that a program is not its source code. A program is a shared mental construct (he uses the word theory) that lives in the minds of the people who work on it. If you lose the people, you lose the program. The code is merely a written representation of the program, and it's lossy, so you can't reconstruct

from tkinter import *
from PIL import ImageTk,Image
import time
import os
targetImageWidth = 850
targetImageHeight = 400
inputImageWidth = 0
inputImageHeight = 0
# Now available here: https://github.com/y0ast/pytorch-snippets/tree/main/minimal_cifar
@piyueh
piyueh / tf_keras_tfp_lbfgs.py
Last active March 31, 2024 02:36
Optimize TensorFlow & Keras models with L-BFGS from TensorFlow Probability
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2019 Pi-Yueh Chuang <pychuang@gwu.edu>
#
# Distributed under terms of the MIT license.
"""An example of using tfp.optimizer.lbfgs_minimize to optimize a TensorFlow model.
@madelinegannon
madelinegannon / jetson-nano_openFrameworks_setup_tutorial.md
Last active February 4, 2024 16:41
How to Set Up the NVIDIA Jetson Nano for openFrameworks
@atabakd
atabakd / kl.py
Last active April 11, 2024 11:31
KL divergence for multivariate samples
# https://mail.python.org/pipermail/scipy-user/2011-May/029521.html
import numpy as np
def KLdivergence(x, y):
"""Compute the Kullback-Leibler divergence between two multivariate samples.
Parameters
----------
x : 2D array (n,d)
@abridgland
abridgland / gaussian-processes-1.ipynb
Last active October 10, 2023 07:49
A Jupyter notebook to accompany Intro to Gaussian Processes - Part I at http://bridg.land/posts/gaussian-processes-1
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@victor-shepardson
victor-shepardson / pytorch-glumpy.py
Last active March 25, 2024 19:47
using pycuda and glumpy to draw pytorch GPU tensors to the screen without copying to host memory
from contextlib import contextmanager
import numpy as np
import torch
from torch import Tensor, ByteTensor
import torch.nn.functional as F
from torch.autograd import Variable
import pycuda.driver
from pycuda.gl import graphics_map_flags
from glumpy import app, gloo, gl
@gluschenko
gluschenko / IK.cs
Created January 7, 2017 20:58
Inverse kinematics, Unity3D
using UnityEngine;
using System.Collections;
public class IK : MonoBehaviour {
public Vector3 Target = new Vector3(-8, 0, 0);
public Vector3 BendTarget = new Vector3(-4, 0, 3);
public float Transition = 1f;
public GameObject[] Members = new GameObject[3];