Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
solving AI alignment

Adrià Garriga-Alonso rhaps0dy

💭
solving AI alignment
View GitHub Profile
@rhaps0dy
rhaps0dy / latexsub.el
Created Oct 12, 2020
LaTeX -> unicode substitution as used in Julia
View latexsub.el
;;; packages.el --- latexsub layer packages file for Spacemacs.
;;
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
;;
;; Author: Adrià Garriga Alonso <adria@k9>
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
@rhaps0dy
rhaps0dy / natural_variational_distribution.py
Created Jul 9, 2020
Natural variational distribution + tests
View natural_variational_distribution.py
#!/usr/bin/env python3
import abc
import torch
from gpytorch.distributions import MultivariateNormal
from gpytorch.lazy import CholLazyTensor
from gpytorch.variational._variational_distribution import \
_VariationalDistribution
View article13-cat.txt
No al Filtre d'Internet de l'Article 13: Protegeixi els meus drets
Estimat diputat al parlament europeu [recipient last name will go here],
Li escric com a científic de la informació, i com a ciutadà de Catalunya que està preocupat pel futur de l'Internet. Considero que l'Internet ha de continuar tenint un caràcter obert, que ens permeti a mi i a les properes generacions fer ús les nostres llibertats fonamentals de compartir i gaudir de la informació en línia, cosa que sembla estar seriosament amenaçada.
La nostra llibertat es veu amenaçada pel llenguatge perillós i poc clar de l'Article 13 de la Directiva sobre Drets d'Autor, tant la versió proposta per la Comissió Europea com l'informe adaptat per la Comissió JURI. Presumptament, l'Article 13 té com a intenció protegir els creadors. A la pràctica, aquesta proposta implica la creació d'un sistema d'algoritmes per a decidir quines parts de text, àudio, vídeo, continguts compartits o imatges (fins i tot els mems) es permetran en línia.
Em preocupen les bar
@rhaps0dy
rhaps0dy / a.txt
Created Feb 2, 2018
Images for Spacemacs issue
@rhaps0dy
rhaps0dy / cartpole.xml
Created Dec 23, 2017
Bullet CartPole simulation files
View cartpole.xml
<mujoco model="inverted pendulum">
<compiler inertiafromgeom="true"/>
<default>
<joint pos="0 0 0" armature="0" damping="0" frictionloss="0" limited="true"/>
<geom pos="0 0 0" contype="0" conaffinity="0" friction="0 0 0"
rgba="0.7 0.7 0 1"/>
<tendon/>
<motor ctrlrange="-1 1" ctrllimited="true"/>
</default>
<option gravity="0 0 -9.81" integrator="RK4" timestep="0.02"/>
@rhaps0dy
rhaps0dy / howto.md
Last active Dec 11, 2016
Vote for a charity in Project Awesome
View howto.md

#How to use this?

  1. Go to a charity's page, such as the AMF or the GFI.

  2. Click. one of the videos and vote, normally. This is so you complete the captcha thing.

  3. Go back to the charity page.

  4. Open the browser console.

View quine.c
#include<stdio.h>
void f(char*b){while(*b){if(*b=='"'||*b=='\\')putchar('\\');if(*b=='\n') printf("\\n"),b++; else putchar(*b++);}}
void g(char *c){printf("%s", c); putchar('"'); f(c); printf("\");}\n");}
int main(){g("#include<stdio.h>\nvoid f(char*b){while(*b){if(*b=='\"'||*b=='\\\\')putchar('\\\\');if(*b=='\\n') printf(\"\\\\n\"),b++; else putchar(*b++);}}\nvoid g(char *c){printf(\"%s\", c); putchar('\"'); f(c); printf(\"\\\");}\\n\");}\nint main(){g(");}
@rhaps0dy
rhaps0dy / char-rnn-tf.py
Created Nov 21, 2015
NaNoGenMo character-based RNN, based on Karpathy's blog and code.
View char-rnn-tf.py
#!/usr/bin/env python2
import tensorflow as tf
import numpy as np
import time
# Hyperparameters
learning_rate = 1e-1
n_hidden = 100
seq_length = 25
n_show = 2500 // seq_length
View current let
(setv test
(let [[a 5]
[b 7]]
(print a b)))
(print (type test))
@rhaps0dy
rhaps0dy / xmonad.hs
Created Feb 18, 2015
xmonad configuration with XFCE
View xmonad.hs
import XMonad
import XMonad.Config.Xfce
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.SetWMName
import qualified Data.Map as M
import qualified XMonad.StackSet as W