JarrettYe commited on
Commit
fc7b26e
1 Parent(s): 33afe5c

weights -> parameters

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -27,11 +27,11 @@ def convert_delta_ts(delta_ts: str) -> List[str]:
27
 
28
 
29
  def interface_func(
30
- weights: str, ratings: str, delta_ts: str, request_retention: float
31
  ) -> Tuple[str, str, str]:
32
- weights = weights.replace("[", "").replace("]", "")
33
  optimizer = Optimizer()
34
- optimizer.w = list(map(lambda x: float(x.strip()), weights.split(",")))
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, weights: List[float]
57
  ) -> Tuple[List[str], List[str]]:
58
- fsrs = FSRS(weights)
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)