weights -> parameters
Browse files
app.py
CHANGED
@@ -27,11 +27,11 @@ def convert_delta_ts(delta_ts: str) -> List[str]:
|
|
27 |
|
28 |
|
29 |
def interface_func(
|
30 |
-
|
31 |
) -> Tuple[str, str, str]:
|
32 |
-
|
33 |
optimizer = Optimizer()
|
34 |
-
optimizer.w = list(map(lambda x: float(x.strip()),
|
35 |
test_sequence = optimizer.preview_sequence(
|
36 |
ratings.replace(" ", ""), request_retention
|
37 |
)
|
@@ -53,9 +53,9 @@ def interface_func(
|
|
53 |
|
54 |
|
55 |
def memory_state_sequence(
|
56 |
-
r_history: str, t_history: str,
|
57 |
) -> Tuple[List[str], List[str]]:
|
58 |
-
fsrs = FSRS(
|
59 |
line_tensor = lineToTensor(list(zip([t_history], [r_history]))[0]).unsqueeze(1)
|
60 |
outputs, _ = fsrs(line_tensor)
|
61 |
stabilities, difficulties = outputs.transpose(0, 1)[0].transpose(0, 1)
|
|
|
27 |
|
28 |
|
29 |
def interface_func(
|
30 |
+
parameters: str, ratings: str, delta_ts: str, request_retention: float
|
31 |
) -> Tuple[str, str, str]:
|
32 |
+
parameters = parameters.replace("[", "").replace("]", "")
|
33 |
optimizer = Optimizer()
|
34 |
+
optimizer.w = list(map(lambda x: float(x.strip()), parameters.split(",")))
|
35 |
test_sequence = optimizer.preview_sequence(
|
36 |
ratings.replace(" ", ""), request_retention
|
37 |
)
|
|
|
53 |
|
54 |
|
55 |
def memory_state_sequence(
|
56 |
+
r_history: str, t_history: str, parameters: List[float]
|
57 |
) -> Tuple[List[str], List[str]]:
|
58 |
+
fsrs = FSRS(parameters)
|
59 |
line_tensor = lineToTensor(list(zip([t_history], [r_history]))[0]).unsqueeze(1)
|
60 |
outputs, _ = fsrs(line_tensor)
|
61 |
stabilities, difficulties = outputs.transpose(0, 1)[0].transpose(0, 1)
|