Skip to content

Instantly share code, notes, and snippets.

View tdavchev's full-sized avatar
🤞
researching

Todor Davchev tdavchev

🤞
researching
View GitHub Profile
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
def smooth(scalars, weight):
last = scalars[0]
smoothed = list()
for point in scalars:
smoothed_val = last * weight + (1-weight)*point
'''
Convert videos to .gif files.
@date: 28.02.2018
@author: Todor Davchev
'''
import argparse
import os
@tdavchev
tdavchev / qp_opt.py
Created January 9, 2021 13:59
QP Optimiser
class QPoptimizer(object):
def __call__(self, feature_num, learner, expert):
w = cp.Variable(feature_num)
obj_func = cp.Minimize(cp.norm(w))
constraints = [(expert-learner) @ w >= 2]
prob = cp.Problem(obj_func, constraints)
prob.solve()
for t in range(T):
exp_feat += gamma**t * (trajectory[t, :] - goal)**2