Commit 5533471e authored by Valentin Reis's avatar Valentin Reis
Browse files

[style] Formatting code, removing useless CI rule.

parent 0502207c
Pipeline #11192 failed with stages
in 7 seconds
......@@ -27,13 +27,6 @@ make:shellcheck:
- nix
script: nix-shell -p gnumake --run "make shellcheck"
make:dhall-format:
stage: source
tags:
- kvm
- nix
script: nix-shell -p gnumake --run "make dhall-format"
nix:package:
stage: build
tags:
......
......@@ -51,6 +51,7 @@ import System.Random
-- * @l@ is a superset of admissible losses \(\mathbb{L}\) (statically
-- known).
class Bandit b hyper a l | b -> l, b -> hyper, b -> a where
-- | Init hyper returns the initial state of the algorithm and the
-- first action.
init :: (RandomGen g) => g -> hyper -> (b, a, g)
......@@ -63,6 +64,7 @@ class Bandit b hyper a l | b -> l, b -> hyper, b -> a where
--
-- * @er@ is an expert representation (see 'ExpertRepresentation')
class (ExpertRepresentation er s a) => ContextualBandit b hyper s a l er | b -> l, b -> hyper, b -> s, b -> a, b -> er where
-- | Init hyper returns the initial state of the algorithm
initCtx :: hyper -> b
......
......@@ -87,17 +87,17 @@ data EpsGreedyHyper a r
-- | The variable rate \(\epsilon\)-Greedy MAB algorithm.
-- Offers no interesting guarantees, works well in practice.
instance (Rate r, Eq a) => Bandit (EpsGreedy a r) (EpsGreedyHyper a r) a Double where
init g (EpsGreedyHyper r (Arms (a :| as))) =
( EpsGreedy
{ t = 1,
rate = r,
lastAction = a,
params =
InitialScreening $
Screening
{ screened = [],
screenQueue = as
}
params = InitialScreening $
Screening
{ screened = [],
screenQueue = as
}
},
a,
g
......
......@@ -63,6 +63,7 @@ instance
(Eq a) =>
Bandit (Exp3 a) (Arms a) a (ZeroOne Double)
where
init g (Arms as) =
( Exp3
{ t = 1,
......
......@@ -93,6 +93,7 @@ instance
(Eq a, ExpertRepresentation er s a) =>
ContextualBandit (Exp4R s a er) (Exp4RCfg s a er) s a (Maybe Feedback) er
where
initCtx Exp4RCfg {..} =
Exp4R
{ t = 1,
......
......@@ -58,18 +58,18 @@ toW (loss, action) = Weight loss 1 action
-- | The variable rate \(\epsilon\)-Greedy MAB algorithm.
-- Offers no interesting guarantees, works well in practice.
instance (InvLFPhi p, Eq a) => Bandit (UCB a p) (UCBHyper a p) a (ZeroOne Double) where
init g (UCBHyper invLFPhiUCB alphaUCB (Arms (a :| as))) =
( UCB
{ t = 1,
alpha = alphaUCB,
invLFPhi = invLFPhiUCB,
lastAction = a,
params =
InitialScreening $
Screening
{ screened = [],
screenQueue = as
}
params = InitialScreening $
Screening
{ screened = [],
screenQueue = as
}
},
a,
g
......
{-#language TypeSynonymInstances#-}
{-# LANGUAGE TypeSynonymInstances #-}
module Bandit.TypesTest where
import Bandit.Types
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment