Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexErrant committed Feb 13, 2024
1 parent 2431f96 commit d7ab93a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
# fsrs-browser

This project runs [fsrs-rs](https://github.com/open-spaced-repetition/fsrs-rs) in the browser with support for training FSRS parameters.

It git submodules [fsrs-rs](https://github.com/AlexErrant/fsrs-rs/tree/fsrs-browser) and [burn](https://github.com/AlexErrant/burn/tree/fsrs-browser) for reasons given [here](https://github.com/Tracel-AI/burn/pull/938#issuecomment-1925913866). As such, it will not be up to date with the latest fsrs-rs.

## Building and demoing

Run `./dev.sh` for fast builds or `./prod.sh` for fast runs.

Run the `/sandbox` project to demo various behavior.

I highly encourage `./prod.sh` if you intend to run training. On my machine training 24,394 FSRS items/revlogs on `./dev` takes days, while `./prod.sh` takes 3.5 seconds.
14 changes: 0 additions & 14 deletions sandbox/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
## Usage

Those templates dependencies are maintained via [pnpm](https://pnpm.io) via `pnpm up -Lri`.

This is the reason you see a `pnpm-lock.yaml`. That being said, any package manager will work. This file can be safely be removed once you clone a template.

```bash
$ npm install # or pnpm install or yarn install
```

### Learn more on the [Solid Website](https://solidjs.com) and come chat with us on our [Discord](https://discord.com/invite/solidjs)

## Available Scripts

In the project directory, you can run:
Expand All @@ -28,7 +18,3 @@ It correctly bundles Solid in production mode and optimizes the build for the be

The build is minified and the filenames include the hashes.<br>
Your app is ready to be deployed!

## Deployment

You can deploy the `dist` folder to any static host provider (netlify, surge, now, etc.)
3 changes: 3 additions & 0 deletions sandbox/src/train.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ async function loadSqliteAndRun(ab: ArrayBuffer) {
await wasm()
await initThreadPool(navigator.hardwareConcurrency)
await sleep(1000) // the workers need time to spin up. TODO, post an init message and await a response. Also maybe move worker construction to Javascript.
console.time('full training time')
let fsrs = new Fsrs()
const db = await getDb(ab)
let baseQuery = `FROM revlog
Expand Down Expand Up @@ -77,7 +78,9 @@ async function loadSqliteAndRun(ab: ArrayBuffer) {
types,
usns,
)
console.timeEnd('full training time')
console.log('trained weights are', weights)
console.log('revlog count', count)
} finally {
db.close()
}
Expand Down

0 comments on commit d7ab93a

Please sign in to comment.