From 7ff2ef6835ef4f2c254de9a61f6c881f34c82cd0 Mon Sep 17 00:00:00 2001 From: Aner Zakobar Date: Thu, 2 Jul 2026 22:42:48 +0300 Subject: [PATCH] Added sympy. Fixed derivation issue. --- content/method/method.tex | 6 ++---- flake.nix | 7 ++++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/content/method/method.tex b/content/method/method.tex index e499914..c6ef4ce 100644 --- a/content/method/method.tex +++ b/content/method/method.tex @@ -602,12 +602,10 @@ Therefore, our derivative to calculate from before is equal to: \frac{\partial \hat{F}_0^{-1}(\alpha ; \mathcal{B}_0)}{\partial f_\theta(\mathbf{x}_i)} = \frac{1}{\sigma^{-1}'\left( \sigma(\tau - f_{\theta}(\mathbf{x}_i)) \right)\cdot\left( \sum_{\mathbf{x}_j \in \mathcal{B}_0 ; j \neq i}\sigma'(\tau - f_{\theta}(\mathbf{x}_j))\right) + 1 } \] -Recalling the inverse derivative identity $\frac{1}{(f^{-1})'(f(x))} = f'(x)$, we note that $\frac{1}{\sigma^{-1}'(\sigma(\tau - f_{\theta}(\mathbf{x}_i)))} = \sigma'(\tau - f_{\theta}(\mathbf{x}_i))$. - -Therefore: +Substituting $\sigma^{-1}'(\sigma(u)) = \frac{1}{\sigma'(u)}$ and multiplying numerator and denominator by $\sigma'(\tau - f_{\theta}(\mathbf{x}_i))$: \[ - \frac{\partial \hat{F}_0^{-1}(\alpha ; \mathcal{B}_0)}{\partial f_\theta(\mathbf{x}_i)} = \frac{\sigma'(\tau - f_{\theta}(\mathbf{x}_i))}{\left( \sum_{\mathbf{x}_j \in \mathcal{B}_0 ; j \neq i}\sigma'(\tau - f_{\theta}(\mathbf{x}_j))\right) + 1} + \frac{\partial \hat{F}_0^{-1}(\alpha ; \mathcal{B}_0)}{\partial f_\theta(\mathbf{x}_i)} = \frac{\sigma'(\tau - f_{\theta}(\mathbf{x}_i))}{\displaystyle\sum_{\mathbf{x}_j \in \mathcal{B}_0}\sigma'(\tau - f_{\theta}(\mathbf{x}_j))} \] Which we can plug back into the ROLL derivation framework. diff --git a/flake.nix b/flake.nix index e14c9cc..05031b8 100644 --- a/flake.nix +++ b/flake.nix @@ -58,7 +58,12 @@ in { devShells.${system}.default = pkgs.mkShell { - buildInputs = [ (pkgs.texlive.combine texPkgs) pkgs.culmus pkgs.fontconfig ]; + buildInputs = [ + (pkgs.texlive.combine texPkgs) + pkgs.culmus + pkgs.fontconfig + (pkgs.python3.withPackages (ps: [ ps.sympy ])) + ]; shellHook = '' export FONTCONFIG_FILE="${fontsConf}" '';