Javascript Brain.js GPU慢速训练
我正在尝试用brain.js训练一个神经网络,但我想知道我的数据是否已经太大了 代码: 正如你所看到的,我有13个特性,以及大约50k的训练数据。Javascript Brain.js GPU慢速训练,javascript,neural-network,brain.js,Javascript,Neural Network,Brain.js,我正在尝试用brain.js训练一个神经网络,但我想知道我的数据是否已经太大了 代码: 正如你所看到的,我有13个特性,以及大约50k的训练数据。 为什么要花这么长时间?减少隐藏网络中的单位可以加快训练速度,但网络无法理解数据。为什么要使用(共享)服务器、使用您的机器或集群中的多台机器。我也在使用我的——但不幸的是,我这里只有一台macbook——CPU和GPU的速度也很慢。大约需要100小时。这正常吗?6万个纪元也相当多。所以你可以预期训练需要很长时间。您可以先尝试优化数据吗?或者买一张昂贵的
为什么要花这么长时间?减少隐藏网络中的单位可以加快训练速度,但网络无法理解数据。为什么要使用(共享)服务器、使用您的机器或集群中的多台机器。我也在使用我的——但不幸的是,我这里只有一台macbook——CPU和GPU的速度也很慢。大约需要100小时。这正常吗?6万个纪元也相当多。所以你可以预期训练需要很长时间。您可以先尝试优化数据吗?或者买一张昂贵的GPU卡。
await getDataSet(type);
const listings = await getFilteredListings(type);
const normalizer = new Normalizer(listings);
normalizer.setOutputProperties(['runningTime']);
normalizer.normalize();
const inputs = normalizer.getBinaryInputDataset();
const outputs = normalizer.getBinaryOutputDataset();
const metadata = normalizer.getDatasetMetaData();
fs.writeFileSync(METADATA_FILE[type],JSON.stringify(metadata));
const trainingData=[];
for(let i=0;i<inputs.length;i++){
trainingData.push({input:inputs[i],output:outputs[i]});
}
const options={
hiddenLayers:[180,60],
};
const net = new NeuralNetworkGPU(
options
);
net.train(trainingData,{
iterations: 60000, // the maximum times to iterate the training data --> number greater than 0
errorThresh: 0.001, // the acceptable error percentage from training data --> number between 0 and 1
log:true,
});
export const featureColumns = [
'location.lat', 'location.lon', 'locationFactor.score', 'constructionYear', 'squareMeter', 'grossReturn','floor',
'pricePerSqm', 'privateOffer', 'foreClosure', 'rented', 'apartmentType', 'condition'];