我在尝试使用RBFNN进行点云到曲面重建,但我无法理解在RBFNN中我的特征向量应该是什么。
能否有人帮助我理解这一点?
目标是达到这样的效果:
从这样的输入开始:
回答:
RBF网络本质上涉及到用一组具有核心属性的函数的线性组合来拟合数据——其中最主要的属性是径向对称性。这些函数的参数是通过基于输入重复呈现时产生的误差进行增量调整来学习的。
如果我理解正确(自从我上次使用这种网络已经过去了很长时间),你的问题涉及到点云数据的预处理。我认为你的点云中的每个点都应该作为一个输入。如果我理解得没错,特征就是你的三个维度,因此每个点已经可以被视为一个“特征向量”。
你还有其他选择需要考虑,即隐藏层中径向基神经元的数量,以及要使用的径向基函数(高斯函数是一个常见的首选)。网络的训练和曲面重建可以通过多种方式进行,但我认为这超出了问题的范围。
我不知道这是否有帮助,但这里有一个简单的Python实现,展示了一个RBF网络进行函数逼近,使用一维输入:
import numpy as npimport matplotlib.pyplot as pltdef fit_me(x): return (x-2) * (2*x+1) / (1+x**2)def rbf(x, mu, sigma=1.5): return np.exp( -(x-mu)**2 / (2*sigma**2));# Core parameters including number of training# and testing points, minimum and maximum x values# for training and testing points, and the number# of rbf (hidden) nodes to usenum_points = 100 # number of inputs (each 1D)num_rbfs = 20.0 # number of centersx_min = -5x_max = 10# Training data, evenly spaced pointsx_train = np.linspace(x_min, x_max, num_points)y_train = fit_me(x_train)# Testing data, more evenly spaced pointsx_test = np.linspace(x_min, x_max, num_points*3)y_test = fit_me(x_test)# Centers of each of the rbf nodescenters = np.linspace(-5, 10, num_rbfs)# Everything is in place to train the network# and attempt to approximate the function 'fit_me'.# Start by creating a matrix G in which each row# corresponds to an x value within the domain and each # column i contains the values of rbf_i(x).center_cols, x_rows = np.meshgrid(centers, x_train)G = rbf(center_cols, x_rows)plt.plot(G)plt.title('Radial Basis Functions')plt.show()# Simple training in this case: use pseudoinverse to get weightsweights = np.dot(np.linalg.pinv(G), y_train)# To test, create meshgrid for test pointscenter_cols, x_rows = np.meshgrid(centers, x_test)G_test = rbf(center_cols, x_rows)# apply weights to G_testy_predict = np.dot(G_test, weights)plt.plot(y_predict)plt.title('Predicted function')plt.show()error = y_predict - y_testplt.plot(error)plt.title('Function approximation error')plt.show()
首先,你可以探索输入如何提供给网络以及如何使用RBF节点。这应该可以直接扩展到二维输入,尽管训练可能会变得更加复杂。
为了进行适当的曲面重建,你可能需要一个与这里学习的函数表示完全不同的曲面表示。不确定如何完成这最后一步。