diff --git a/server/train-ai/DatasetFetcher.mjs b/server/train-ai/DatasetFetcher.mjs index f6311cf..a28dd2b 100644 --- a/server/train-ai/DatasetFetcher.mjs +++ b/server/train-ai/DatasetFetcher.mjs @@ -40,9 +40,7 @@ class DatasetFetcher { ), 0, 1); - result.input.push(next_input); - - console.log(`Distance from gateway: ${haversine(gateway_location, rssi)}m`); + // console.log(`Distance from gateway: ${haversine(gateway_location, rssi)}m`); let next_output = clamp(normalise(rssi.rssi, { min: this.settings.ai.rssi_min, max: this.settings.ai.rssi_max }, @@ -56,12 +54,16 @@ class DatasetFetcher { } for(let reading of this.repo_reading.iterate_unreceived()) { - result.input.push(this.normalise_latlng( + let next_input = this.normalise_latlng( reading.latitude, reading.longitude - )); + ); + next_input.distance = haversine(gateway_location, reading); - result.output.push([ 0 ]); + result.push({ + input: next_input, + output: 0 + }); } return result;