Thanks to visit codestin.com
Credit goes to github.com

Skip to content

LintDAO/ic-burn

Repository files navigation

ic-burn

ic-burn is a sample project to port rust's burn library to IC.

It uses IC's random number API raw_rand instead of burn's getrandom.

Train an LSTM (Long Short-Term Memory) model and reason about the corresponding price through the Binance ICP price history in 2024.

Prerequisites

Rust: Version 1.85.0.

DFX: Version 0.24.3.

Node.js: Version v16.13.1.

Installation

npm i
dfx deploy

Useage

  1. Must upload /assets/icp_history_price_2024.json via the front-end on the first run, otherwise there is no data for train or predict.

  2. The following train method must be executed for the first run, otherwise model initialization is not possible

dfx canister call ic_burn_backend train '(5:nat64)'

Show:

2025-04-18 07:40:02.643838571 UTC: [Canister bkyz2-fmaaa-aaaaa-qaaaq-cai] Epoch 1: Loss = 0.07873835
2025-04-18 07:40:02.643838571 UTC: [Canister bkyz2-fmaaa-aaaaa-qaaaq-cai] Epoch 2: Loss = 0.0785257
2025-04-18 07:40:02.643838571 UTC: [Canister bkyz2-fmaaa-aaaaa-qaaaq-cai] Epoch 3: Loss = 0.07831413
2025-04-18 07:40:02.643838571 UTC: [Canister bkyz2-fmaaa-aaaaa-qaaaq-cai] Epoch 4: Loss = 0.07810363
2025-04-18 07:40:02.643838571 UTC: [Canister bkyz2-fmaaa-aaaaa-qaaaq-cai] Epoch 5: Loss = 0.07789419
  1. Run predict
dfx canister call ic_burn_backend predict

Show:

(3.2142498 : float32)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published