QuizGenerator 0.4.3__py3-none-any.whl → 0.4.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -883,11 +883,18 @@ class MomentumOptimizerQuestion(Question, TableQuestionMixin, BodyTemplatesMixin
883
883
  ))
884
884
 
885
885
  # Show calculation for each component
886
+ digits = Answer.DEFAULT_ROUNDING_DIGITS
886
887
  for i in range(self.num_variables):
887
888
  var_name = f"x_{i}"
889
+ # Round all intermediate values to avoid floating point precision issues
890
+ beta_times_v = round(self.momentum_beta * self.prev_velocity[i], digits)
891
+ one_minus_beta = round(1 - self.momentum_beta, digits)
892
+ one_minus_beta_times_grad = round((1 - self.momentum_beta) * self.gradients[i], digits)
893
+
888
894
  explanation.add_element(ContentAST.Equation(
889
- f"v'[{i}] = {self.momentum_beta} \\times {self.prev_velocity[i]:.2f} + "
890
- f"{1 - self.momentum_beta} \\times {self.gradients[i]:.4f} = {self.new_velocity[i]:.4f}",
895
+ f"v'[{i}] = {self.momentum_beta} \\times {self.prev_velocity[i]:.{digits}f} + "
896
+ f"{one_minus_beta:.{digits}f} \\times {self.gradients[i]:.{digits}f} = "
897
+ f"{beta_times_v:.{digits}f} + {one_minus_beta_times_grad:.{digits}f} = {self.new_velocity[i]:.{digits}f}",
891
898
  inline=False
892
899
  ))
893
900
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: QuizGenerator
3
- Version: 0.4.3
3
+ Version: 0.4.4
4
4
  Summary: Generate randomized quiz questions for Canvas LMS and PDF exams
5
5
  Project-URL: Homepage, https://github.com/OtterDen-Lab/QuizGenerator
6
6
  Project-URL: Documentation, https://github.com/OtterDen-Lab/QuizGenerator/tree/main/documentation
@@ -44,9 +44,9 @@ QuizGenerator/premade_questions/cst463/models/weight_counting.py,sha256=k_FVS3JY
44
44
  QuizGenerator/premade_questions/cst463/neural-network-basics/__init__.py,sha256=pmyCezO-20AFEQC6MR7KnAsaU9TcgZYsGQOMVkRZ-U8,149
45
45
  QuizGenerator/premade_questions/cst463/neural-network-basics/neural_network_questions.py,sha256=gd5zI-6gmXUiK8GaCOCq0IlOwDg4YS0NlOdoN9v_flo,44810
46
46
  QuizGenerator/premade_questions/cst463/tensorflow-intro/__init__.py,sha256=G1gEHtG4KakYgi8ZXSYYhX6bQRtnm2tZVGx36d63Nmo,173
47
- QuizGenerator/premade_questions/cst463/tensorflow-intro/tensorflow_questions.py,sha256=dPn8Sj0yk4m02np62esMKZ7CvcljhYq3Tq51nY9aJnA,29781
48
- quizgenerator-0.4.3.dist-info/METADATA,sha256=VZSWAE0DkhzAn4gqwZ_IjpOI_asXF0lyltJL8494sUs,7212
49
- quizgenerator-0.4.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
50
- quizgenerator-0.4.3.dist-info/entry_points.txt,sha256=aOIdRdw26xY8HkxOoKHBnUPe2mwGv5Ti3U1zojb6zxQ,98
51
- quizgenerator-0.4.3.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
52
- quizgenerator-0.4.3.dist-info/RECORD,,
47
+ QuizGenerator/premade_questions/cst463/tensorflow-intro/tensorflow_questions.py,sha256=z2eMjDFQnyjoKglJ4cuZKWFmN9n3Dt7UTwuMLhriWLM,30244
48
+ quizgenerator-0.4.4.dist-info/METADATA,sha256=sxm0mKRsHvLNX99ZFRBcjpZnQ6puZ4WZf-e8JgjmafE,7212
49
+ quizgenerator-0.4.4.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
50
+ quizgenerator-0.4.4.dist-info/entry_points.txt,sha256=aOIdRdw26xY8HkxOoKHBnUPe2mwGv5Ti3U1zojb6zxQ,98
51
+ quizgenerator-0.4.4.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
52
+ quizgenerator-0.4.4.dist-info/RECORD,,