有什么方法可以将hrm文件(hrm file)读入R而不以超级混乱的数据帧结尾吗?
答案 0 :(得分:0)
我终于在RHRV package的描述中找到了答案:
void NeuralNetwork::deleteNeuron(int t_layer, int t_neuronToDelete){
if(t_layer < 0 || t_layer >= neuralNetwork.size())
throw LayerDoesNotExistException();
int numOfNeurons = neuralNetwork[t_layer].neurons.size();
if(t_neuronToDelete < 0 || t_neuronToDelete >= numOfNeurons)
throw NeuronDoesNotExistException();
//delete neuron
//removes neuron
neuralNetwork[t_layer].neurons.erase(neuralNetwork[t_layer].neurons.begin() + t_neuronToDelete);
//remove its edge from neurons to the right
if(t_layer != neuralNetwork.size())//doesnt let it remove edges if its the output layer
for(int i=0; i < neuralNetwork[t_layer+1].neurons.size(); i++){
std::vector<double*>::iterator it = neuralNetwork[t_layer+1].neurons[i].pWeights.begin() + t_neuronToDelete;
//this line segfaults
neuralNetwork[t_layer+1].neurons[i].pWeights.erase(it);
}
}