function-approximation

Keras Regression to approximate function (goal: loss < 1e-7)

六眼飞鱼酱① 提交于 2021-02-19 07:30:08
问题 I'm working on a neural network which approximates a function f(X)=y, with X a vector [x0, .., xn] and y in [-inf, +inf]. This approximated function needs to have an accuracy (sum of errors) around 1e-8. In fact, I need my neural network to overfit. X is composed of random points in the interval -500 and 500. Before putting these points into the input layer I normalized them between [0, 1]. I use keras as follow: dimension = 10 #example self.model = Sequential() self.model.add(Dense(128,

Taylor Series Difference between exp(-x) and exp(+x)

微笑、不失礼 提交于 2019-12-24 13:40:15
问题 I'm trying to write a program which calculates the Taylor series of exp(-x) and exp(x) up to 200 iterations, for large x. (exp(x)=1+x+x^2/2+...). My program is really simple, and it seems like it should work perfectly. However it diverges for exp(-x), but converges just fine for exp(+x). Here is my code so far: long double x = 100.0, sum = 1.0, last = 1.0; for(int i = 1; i < 200; i++) { last *= x / i; //multiply the last term in the series from the previous term by x/n sum += last; //add this

When using functional approximation in reinforcement learning how does one select actions?

ε祈祈猫儿з 提交于 2019-12-24 12:57:29
问题 This slide shows an equation for Q(state, action) in terms of a set of weights and feature functions. I'm confused about how to write the feature functions. Given an observation, I can understand how to extract features from the observation. But given an observation, one doesn't know what the result of taking an action will be on the features. So how does one write a function that maps an observation and an action to a numerical value? In the Pacman example shown a few slides later, one knows