Skip to content

Numerical Instability Problem Solved with CPU-version C++ .find_span() for curve_eval.cpp #5

@mechyai

Description

@mechyai

I was dealing with frequent 'randomly' occurring Nan results for the basis function evaluations when using the CPU, C++ curve_eval.cpp -- curve_pre_compute_basis(...) function which is used in curve_eval.py here (just for those new to this repo and facing the same issue). This would would then cause Nan in the curve evaluation and destroy any torch optimization loop.
I was able to solve this issue by removing the eps values in the .find_span() function here:

while (u < U[mid]-eps || u >= U[mid+1]+eps){

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions