This commit is contained in:
2026-04-20 00:21:53 +09:00
parent 4b08883f69
commit 53e9908167
31 changed files with 3535 additions and 111 deletions

11
scripts/predict.ts Normal file
View File

@@ -0,0 +1,11 @@
import * as tf from "@tensorflow/tfjs-node";
async function predict(factors: number[]) {
const model = await tf.loadLayersModel("file://sample/model/model.json");
const input = tf.tensor2d([factors]);
const prediction = model.predict(input) as tf.Tensor;
console.log(`Predicted Constant: ${prediction.dataSync()[0].toFixed(2)}`);
}
// 예시: [physical, stamina, tech, reading]
predict([12.5, 26, 0.41, 0.0]).catch(console.error);