Skip to content

Instantly share code, notes, and snippets.

View kschoos's full-sized avatar
💭
Playing

Kai Schoos kschoos

💭
Playing
View GitHub Profile
#include <stdbool.h>
#include <stdint.h>
#include "boards.h"
#include "bsp.h"
#include "app_timer.h"
#include "nordic_common.h"
#include "nrf_error.h"
#include "nrfx_timer.h"
class NewDQNAgent(ReinforcementAgent):
def loss(self, y_true, y_pred):
return self.huber_loss(y_true, y_pred)
def huber_loss(self, y_true, y_pred):
'''
Design Huber Loss according to wikipedia:
L(e) = 1/2 e^2 if |e| <= d, else d(|e| - 1/2d)
'''
import signal
import sys
from keras import losses
from keras.callbacks import TensorBoard, CallbackList
from keras.engine.saving import load_model
from keras.initializers import Zeros, VarianceScaling
from keras.optimizers import Adam
from keras.layers import Input, Permute, Convolution2D, Activation, Flatten, Dense, Layer
from keras import Model
import stuff
def identity_loss(y_true, y_pred):
return y_pred
class TensorBoardWrap(TensorBoard):
def __init__(self, val_data, **args):
TensorBoard.__init__(self, **args)
self.validation_data = val_data

Anhang 1: Pseudocode

Function RECURSIVE-SORT-AND-FIND-UNIQUES(Matrix, start, size, depth)
	end <- start + n-1	
	down_runner <- start
	up_runner <- end
	zeros <- 0
	ones <- 0