Skip to content

Instantly share code, notes, and snippets.

@lotz84
lotz84 / Main.hs
Last active December 26, 2019 07:35
"Fast and Accurate Least-Mean-Squares Solvers" in Haskell https://arxiv.org/abs/1906.04705
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE NoStarIsType #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# OPTIONS_GHC -fplugin GHC.TypeLits.KnownNat.Solver #-}
{-# OPTIONS_GHC -fplugin GHC.TypeLits.Normalise #-}
@youheiakimoto
youheiakimoto / ddcma.py
Last active April 19, 2023 08:00
dd-CMA: CMA-ES with diagonal decoding
import warnings
from collections import deque
import math
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
class DdCma:
"""dd-CMA: CMA-ES with diagonal decoding [1]
from __future__ import division # use // for integer division
from __future__ import absolute_import # use from . import
from __future__ import print_function # use print("...")
from __future__ import unicode_literals # all the strings are unicode
__author__ = 'Youhei Akimoto'
import numpy as np
from numpy import sqrt, exp, log