Skip to content

Commit

Permalink
Remove Factor and Decay, Always show labels,
Browse files Browse the repository at this point in the history
New defaults
  • Loading branch information
xiety committed May 15, 2024
1 parent f8f8860 commit 0c690b7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
8 changes: 4 additions & 4 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ import {
} from 'chart.js';
import type { ChartData, ChartDataset } from 'chart.js';
import { Card, FsrsCalculator } from './fsrsCalculator';
import { sliders, additionalSliders } from './sliderInfo';
import { sliders, additionalSliders, default_weights } from './sliderInfo';
import { useManualRefHistory } from '@vueuse/core';
import zoomPlugin from 'chartjs-plugin-zoom';
import ChartDataLabels from 'chartjs-plugin-datalabels';
Expand Down Expand Up @@ -172,8 +172,8 @@ const scores_text = computed({
set: (newValue) => scores.value = newValue.split('\n').map(a => a.split('').filter(b => ['1', '2', '3', '4'].includes(b)).map(Number)),
});
const initial_w = [0.5614, 1.2546, 3.5878, 7.9731, 5.1043, 1.1303, 0.8230, 0.0465, 1.6290, 0.1350, 1.0045, 2.1320, 0.0839, 0.3204, 1.3547, 0.2190, 2.7849];
const initial_m = [0.9, -0.5, 19 / 81];
const initial_w = default_weights;
const initial_m = [0.9];
const fsrs_params = ref({
w: [...initial_w],
Expand Down Expand Up @@ -208,7 +208,7 @@ function createData(): ChartData<'line', MyData[]> {
const data = computed(createData);
const w_text = computed({
get: () => fsrs_params.value.w.join(', '),
get: () => fsrs_params.value.w.map(f => f.toFixed(4)).join(', '),
set: (newValue) => fsrs_params.value.w = newValue.split(', ').map(parseFloat)
});
Expand Down
2 changes: 1 addition & 1 deletion src/chartOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function createOptions(): ChartOptions<'line'> {
color: '#36A2EB',
align: 'left',
anchor: 'center',
display: 'auto',
display: true,
formatter: (obj, _) => obj.label, //TODO: type
},
colors: {
Expand Down
4 changes: 2 additions & 2 deletions src/fsrsCalculator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export class FsrsCalculator {
public constructor(w: number[], m: number[]) {
this.w = w;
this.desiredR = m[0];
this.decay = m[1];
this.factor = m[2];
this.decay = -0.5;
this.factor = 19.0 / 81.0;
}

calcInterval(r: number, s: number): number {
Expand Down
18 changes: 10 additions & 8 deletions src/sliderInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@ export interface SliderInfo {
max: number
}

// https://github.com/open-spaced-repetition/fsrs-rs/blob/main/src/inference.rs
export const default_weights = [0.5701, 1.4436, 4.1386, 10.9355, 5.1443, 1.2006, 0.8627, 0.0362, 1.6290, 0.1342, 1.0166, 2.1174, 0.0839, 0.3204, 1.4676, 0.2190, 2.8237];

// https://github.com/open-spaced-repetition/fsrs-rs/blob/main/src/weight_clipper.rs
export const sliders: SliderInfo[] = [
{ name: "0. initial stability (Again)", min: 0.1, max: 100 },
{ name: "1. initial stability (Hard)", min: 0.1, max: 100 },
{ name: "2. initial stability (Good)", min: 0.1, max: 100 },
{ name: "3. initial stability (Easy)", min: 0.1, max: 100 },
{ name: "0. initial stability (Again)", min: 0.01, max: 100 },
{ name: "1. initial stability (Hard)", min: 0.01, max: 100 },
{ name: "2. initial stability (Good)", min: 0.01, max: 100 },
{ name: "3. initial stability (Easy)", min: 0.01, max: 100 },
{ name: "4. initial difficulty (Good)", min: 1, max: 10 },
{ name: "5. initial difficulty (multiplier)", min: 0.1, max: 5 },
{ name: "6. difficulty (multiplier)", min: 0.1, max: 5 },
{ name: "7. difficulty (multiplier)", min: 0, max: 0.75 },
{ name: "8. stability (exponent)", min: 0, max: 4 },
{ name: "9. stability (negative power)", min: 0.1, max: 0.8 },
{ name: "10. stability (exponent)", min: 0.01, max: 3.0 },
{ name: "9. stability (negative power)", min: 0.0, max: 0.8 },
{ name: "10. stability (exponent)", min: 0.01, max: 3 },
{ name: "11. fail stability (multiplier)", min: 0.5, max: 5 },
{ name: "12. fail stability (negative power)", min: 0.01, max: 0.2 },
{ name: "13. fail stability (power)", min: 0.01, max: 0.9 },
Expand All @@ -26,6 +30,4 @@ export const sliders: SliderInfo[] = [

export const additionalSliders: SliderInfo[] = [
{ name: "desired retention", min: 0.8, max: 0.99 },
{ name: "decay", min: -2, max: -0.1 },
{ name: "factor", min: 0.01, max: 2 },
];

0 comments on commit 0c690b7

Please sign in to comment.