Questions tagged [function-approximation]

A function that implements an approximation solution for a problem. In general, the function approximation problem asks us to select a function among a well-defined class that closely matches ("approximates") a target function in a task-specific way

In computer science, they are many times that we can not compute something with full accuracy, because it's infinite. For example, in order to compute the value of cosine(π), we perform some approximation.

The function that would perform the computation of cosine(π) approximately is a function that uses approximation.

This tag should be used for problems that have to do with functions that implement an approximation solution for a problem.

Sometimes, these functions receive an ε parameter, which controls the approximation. Usually, ε, is called an approximation factor.

59 questions
8
votes
1 answer

Fast approximate algorithm for RGB/LAB conversion?

I am working on a data visualization tool using OpenGL, and the LAB color space is the most comprehensible color space for visualization of the data I'm dealing with (3 axes of data are mapped to the 3 axes of the color space). Is there a fast (e.g.…
6
votes
1 answer

How to compute sincos fast on a x64 CPU?

This is a question addresed to users, experienced in SSE/AVX instruction family, and those of them, who are familiar with its performance analysis. I saw a lot of different implementations and approaches, ranging from older for SSE2 to newer ones.…
xakepp35
  • 1,949
  • 2
  • 18
  • 36
6
votes
1 answer

Approximating log2(float) by separating significand and exponent

Problem I am trying to implement a fast float = log2(float). I wrote a simple C program to compare my results with log2 and I get a small error that I can't find a source for. Background I am taking the approach of identifying the floating point…
n-west
  • 118
  • 5
4
votes
1 answer

Java- Looking for advice on calculating the min/max for a function or the derivative in step intervals

Looking for advice on a math problem that has turned into a Java nightmare. I scanned the web and could not find a solution. I have looked at similar programs and unfortunately couldn't find help. Summary of the problem: I am looking to implement a…
Axion004
  • 873
  • 1
  • 8
  • 33
4
votes
1 answer

In Q-learning with function approximation, is it possible to avoid hand-crafting features?

I have little background knowledge of Machine Learning, so please forgive me if my question seems silly. Based on what I've read, the best model-free reinforcement learning algorithm to this date is Q-Learning, where each state,action pair in the…
3
votes
1 answer

Plotting Legendre Polynomials - Getting different results for own method

I'm trying to plot the legendre polynomials, defined as: P0(x) = 1 P1(x) = x Pn+1(x) = ((2n+1)/(n+1)) * x * Pn(x) - (n / (n+1)) * Pn-1(x) I've done it the easy slow way, and I've done it the direct, a little more complicated way. Both result in a…
2
votes
2 answers

Is such a normalization right for wiggly curves?

I am training a neural network (in C++, without any additional library), to learn a random wiggly function: f(x)=0.2+0.4x2+0.3sin(15x)+0.05cos(50x) Plotted in Python as: lim = 500 for i in range(lim): x.append(i) p = 2*3.14*i/lim …
2
votes
2 answers

Evaluating the inverse of a function

I need to evaluate the inverse of this function in the domain [0,1): There is an analytic inverse (which I won't bother putting here as it's quite big), but it only works for a limited range of the constant A, i.e. if A>0.385f(x). Then, I thought of…
2
votes
1 answer

Newtonraphson code in R leads to different results

I need to approximate the parameters of a sample from Birnbaum-Saunders distr. here is my code: x =c(6.7508, 1.9345, 4.9612, 22.0232, 0.2665, 66.7933, 5.5582, 60.2324, 72.5214, 1.4188, 4.6318, 61.8093, 11.3845, 1.1587, 22.8475, 8.3223, 2.6085,…
2
votes
1 answer

MATLAB's newrb for designing radial basis networks does not behave in accordance to the documentation. Why?

I'm trying to approximate various signals using radial basis networks. In particular, I make use of MATLAB's newrb. My problem is that this function seems to behave incorrectly if I follow the description of newrb. As I understand it, it makes sense…
Maryks
  • 73
  • 6
2
votes
1 answer

Solving GridWorld using Q-Learning and function approximation

I'm studying the simple GridWorld (3x4, as described in Russell & Norvig Ch. 21.2) problem; I've solved it using Q-Learning and a QTable, and now I'd like to use a function approximator instead of a matrix. I'm using MATLAB and have tried both…
2
votes
2 answers

How do you update the weights in function approximation with reinforcement learning?

My SARSA with gradient-descent keep escalating the weights exponentially. At Episode 4 step 17 the value is already nan Exception: Qa is nan e.g: 6) Qa: Qa = -2.00890180632e+303 7) NEXT Qa: Next Qa with west = -2.28577776413e+303 8)…
1
vote
0 answers

Convergence guarantee of Policy Gradient with function approximation

Is there any convergence proof of the Policy Gradient algorithm with "general" value/Q function approximation ? Seminal papers (Sutton1999 & Tsitsiklis1999) prove the theorem using a compatibility assumption (i.e. the Q-function approximation is…
1
vote
0 answers

Is there a function which can approximate the function of a 2D-Line-Plot?

I'm working on this tree visualizer. I was just wondering, how to approximate a function from a given image. Is there a convenient library for this? What I want to draw looks like exactly like this: I had the idea to look at each curve separately.…
1
vote
1 answer

How do you find an equation of a plane that best approximates 3 dimensional data in MATLAB?

I have the following 3 dimensional data in MATLAB: tau = [6e-9 30e-12 6e-9 30e-12]; E=[1e-3 50e-6 .01 1e-3]; k=[6.93774E-08 1.23666E-08 4.45261E-08 1.90789E-08]; plot3(tau, E, k,'*'); xlabel('tau (s)'); ylabel('Energy (J)'); zlabel('k'); You can…
user1068636
  • 1,619
  • 7
  • 29
  • 53
1
2 3 4