From b87a51596f0eefc13ad1cc87df908e9a1c1fcc10 Mon Sep 17 00:00:00 2001 From: amirDahari1 Date: Wed, 8 Nov 2023 18:15:01 +0000 Subject: [PATCH 01/12] changed the error term in check_vertical_flux --- taufactor/taufactor.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/taufactor/taufactor.py b/taufactor/taufactor.py index d18ed9e..cd87bec 100644 --- a/taufactor/taufactor.py +++ b/taufactor/taufactor.py @@ -149,6 +149,9 @@ def solve(self, iter_limit=5000, verbose=True, conv_crit=2*10**-2): out /= self.nn # check convergence using criteria if self.iter % 100 == 0: + # plt.imshow(self.conc[0,0,3:-2,290:-2].cpu().numpy()) + # print('hello') + # plt.show() self.converged = self.check_convergence( verbose, conv_crit, start, iter_limit) # efficient way of adding flux to old conc with overrelaxation @@ -198,7 +201,7 @@ def check_vertical_flux(self, conv_crit): vert_flux[self.conc[:, :-2, 1:-1, 1:-1] == 0] = 0 vert_flux[self.conc[:, 1:-1, 1:-1, 1:-1] == 0] = 0 fl = torch.sum(vert_flux, (0, 2, 3))[1:-1] - err = (fl.max() - fl.min())*2/(fl.max() + fl.min()) + err = (fl.max() - fl.min())/(fl.max()) if fl.min() == 0: return 'zero_flux', torch.mean(fl), err if err < conv_crit or torch.isnan(err).item(): From e43546a33acabeaa6812b18d1f7b79e895ac71cf Mon Sep 17 00:00:00 2001 From: amirDahari1 Date: Wed, 8 Nov 2023 18:16:31 +0000 Subject: [PATCH 02/12] wo plt lines --- taufactor/taufactor.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/taufactor/taufactor.py b/taufactor/taufactor.py index cd87bec..9ded7f2 100644 --- a/taufactor/taufactor.py +++ b/taufactor/taufactor.py @@ -149,9 +149,6 @@ def solve(self, iter_limit=5000, verbose=True, conv_crit=2*10**-2): out /= self.nn # check convergence using criteria if self.iter % 100 == 0: - # plt.imshow(self.conc[0,0,3:-2,290:-2].cpu().numpy()) - # print('hello') - # plt.show() self.converged = self.check_convergence( verbose, conv_crit, start, iter_limit) # efficient way of adding flux to old conc with overrelaxation From 9c3c3c11cc910fb48451a004c0d45db42818d87a Mon Sep 17 00:00:00 2001 From: amirDahari1 Date: Mon, 13 Nov 2023 14:56:57 +0000 Subject: [PATCH 03/12] exit solve after iter_limit reached --- taufactor/taufactor.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/taufactor/taufactor.py b/taufactor/taufactor.py index d18ed9e..44b47e8 100644 --- a/taufactor/taufactor.py +++ b/taufactor/taufactor.py @@ -137,7 +137,7 @@ def solve(self, iter_limit=5000, verbose=True, conv_crit=2*10**-2): with torch.no_grad(): start = timer() - while not self.converged: + while not self.converged and self.iter < iter_limit: # find sum of all nearest neighbours out = self.conc[:, 2:, 1:-1, 1:-1] + \ self.conc[:, :-2, 1:-1, 1:-1] + \ @@ -149,8 +149,7 @@ def solve(self, iter_limit=5000, verbose=True, conv_crit=2*10**-2): out /= self.nn # check convergence using criteria if self.iter % 100 == 0: - self.converged = self.check_convergence( - verbose, conv_crit, start, iter_limit) + self.converged = self.check_convergence(verbose, conv_crit) # efficient way of adding flux to old conc with overrelaxation out -= self.crop(self.conc, 1) out *= self.cb[self.iter % 2] @@ -161,7 +160,7 @@ def solve(self, iter_limit=5000, verbose=True, conv_crit=2*10**-2): self.end_simulation(iter_limit, verbose, start) return self.tau - def check_convergence(self, verbose, conv_crit, start, iter_limit): + def check_convergence(self, verbose, conv_crit): # print progress self.semi_converged, self.new_fl, err = self.check_vertical_flux( conv_crit) From a4f344003f44e251c92cbdfd0440da8b1f623068 Mon Sep 17 00:00:00 2001 From: amirDahari1 Date: Mon, 13 Nov 2023 15:27:02 +0000 Subject: [PATCH 04/12] deleteing iter_limit from all check_convergence solvers --- taufactor/taufactor.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/taufactor/taufactor.py b/taufactor/taufactor.py index 44b47e8..6e7573b 100644 --- a/taufactor/taufactor.py +++ b/taufactor/taufactor.py @@ -275,8 +275,7 @@ def solve(self, iter_limit=5000, verbose=True, conv_crit=2*10**-2, D_0=1): out = out[:, 2:-2] out /= self.nn if self.iter % 50 == 0: - self.converged = self.check_convergence( - verbose, conv_crit, start, iter_limit) + self.converged = self.check_convergence(verbose, conv_crit) out -= self.conc[:, 2:-2] out *= self.cb[self.iter % 2] self.conc[:, 2:-2] += out @@ -440,8 +439,7 @@ def solve(self, iter_limit=5000, verbose=True, conv_crit=2*10**-2): self.pre_factors[5][:, 1:-1, 1:-1, :-2] out /= self.nn if self.iter % 20 == 0: - self.converged = self.check_convergence( - verbose, conv_crit, start, iter_limit) + self.converged = self.check_convergence(verbose, conv_crit) out -= self.crop(self.conc, 1) out *= self.cb[self.iter % 2] self.conc[:, 1:-1, 1:-1, 1:-1] += out @@ -449,7 +447,7 @@ def solve(self, iter_limit=5000, verbose=True, conv_crit=2*10**-2): self.end_simulation(iter_limit, verbose, start) return self.tau - def check_convergence(self, verbose, conv_crit, start, iter_limit): + def check_convergence(self, verbose, conv_crit): # print progress if self.iter % 100 == 0: self.semi_converged, self.new_fl, err = self.check_vertical_flux( From e6b5284c560b02e05a8fb3ce5ddcbb3db9fe6164 Mon Sep 17 00:00:00 2001 From: amirDahari1 Date: Mon, 13 Nov 2023 15:39:18 +0000 Subject: [PATCH 05/12] docs test change --- basil.tif | Bin 0 -> 133390 bytes test_run.py | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 basil.tif create mode 100644 test_run.py diff --git a/basil.tif b/basil.tif new file mode 100644 index 0000000000000000000000000000000000000000..6b2073275cb23f916e6685b8120a1104464c12ca GIT binary patch literal 133390 zcmeI3Td03qRmb=KpL6UOA{u%W6%jEwh?Gi!*^AJHgl-QKK?WvyQ1RhFB1Ks}NEh&- z+e35#AA)=c@ku0n2ssZ?5fMc`#K|BInP#_RnVB``nrmLheT?;6Ywfl7UO)KnHRl-P zGr!+4*X6g){{PQg-}>6CN3X7~o_}?9{qWUw8oe?7xgN$3t{x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ujlgZ|Gw2;{>-nh=kmdSY~}JTzq_8xk8bAj;oo1+<@Z0k)n5Mb$JcZD>}D=M{D-<;-t}C5_w`mTU;6&_Tz+9Qmw)@g z^<4g1`g^8r&iF@uaXpuBdT1+`KmM!hxqNyvmyiGUdM-co@K$^Ih2LAx Date: Mon, 13 Nov 2023 15:47:17 +0000 Subject: [PATCH 06/12] without added files --- basil.tif | Bin 133390 -> 0 bytes test_run.py | 40 ---------------------------------------- 2 files changed, 40 deletions(-) delete mode 100644 basil.tif delete mode 100644 test_run.py diff --git a/basil.tif b/basil.tif deleted file mode 100644 index 6b2073275cb23f916e6685b8120a1104464c12ca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 133390 zcmeI3Td03qRmb=KpL6UOA{u%W6%jEwh?Gi!*^AJHgl-QKK?WvyQ1RhFB1Ks}NEh&- z+e35#AA)=c@ku0n2ssZ?5fMc`#K|BInP#_RnVB``nrmLheT?;6Ywfl7UO)KnHRl-P zGr!+4*X6g){{PQg-}>6CN3X7~o_}?9{qWUw8oe?7xgN$3t{x$2>Loa>%5jGuq~ z;OeC*_KEc8g)^I>7Y{X$4Qsw+9zXTmtE-n?KQgWVbYfpVkDp27#|QQeY5nJ=*ca2E z@A=&I)la|rC*J*IPrmEbZ+_K}eCz99_p0*eM?aXd@RNOxf8PI|C!ToXJ@0$hH$C}N zurSRY)DOu>feJj33P^kpqBTO)mB3_7$uCU#ccuzF2qOn2YD4bhf;^8*Zr7f)`#djejaWNilW1r4NzfxjBAJS4{d=Cv#{GvpD zDg_qE<@w`8O7Z;D!GL;?3M z62d9jflwvbK2|2!Yf;tU2o+e+28Upc;UB)uDbAS^6VAFq+?5o!y?SqXhxH1ay+Z_U z&6tO`YSDY5VS=Qi=Wp5XUWu#`*u|CMfu@6(I$hwVBC+kvw`l%&-InSIG7vtM5pWrU zfCIsRiBKR#)GcEP4dDSrMFM1z6$wd1ln@&U6AB=>(g+?26Dq)J+&IBrzB{-g68Wo- zd{}p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y) zBaB5+I%%MYHP!3&ELl6;;sk_5mPrt&T42E@hFZ|H*UZID#fdfj-m0~hU5A0&v)mf_ zr*~g2A-p18!|Q7#yehfl!g+h&wQjN&Q_M(=*rPh?YHGav@Yx#xpB4hrv*(&<=(=vZoMa3pGs9KmufVlr0OaT6TSUeju_AJe*Z zGD@^yO_C$1)+dG4YhZRFV91y)Ba}t!WigawjbVz0T#k!XEa-SD*Ve1+w&V81te|X4 zGcymCdcy0d^CY6?nPiyAjWFvdp*@InGb;}GRJ4!$Xy8|pqPg=3GSx?z1~_Gg`ZSbm zkMS@80gnhKY+r;h5kibT3ga~xVQCT`v`9_}bVMj1;ZB(QHM0ZZL`K4g0AkVgV(K7? zJZ+l;CLoHank(Tt>qk_crZvYCv>pL%I@eAkrr@sE`>cvC+v0Y^39*$ z%H<0lU(e-dH*@({Z&=UeFMMIEz5LB@U(e<1{&_2xZ~w0KT>j-|E?@Nn>$&{NFK)G$ z|M0`>xqRinY~}K!?_AI2Q=7Sb-}}~c`QCrsYA;{^f%ROz;NP}#`RvcF=kgPqx%}iW zujlgZ|Gw2;{>-nh=kmdSY~}JTzq_8xk8bAj;oo1+<@Z0k)n5Mb$JcZD>}D=M{D-<;-t}C5_w`mTU;6&_Tz+9Qmw)@g z^<4g1`g^8r&iF@uaXpuBdT1+`KmM!hxqNyvmyiGUdM-co@K$^Ih2LAx Date: Tue, 14 Nov 2023 12:08:48 +0000 Subject: [PATCH 07/12] for readthedocs sphinx problem --- docs/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/conf.py b/docs/conf.py index 684e554..2e638f8 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -84,6 +84,7 @@ # a list of builtin themes. # html_theme = 'sphinx_rtd_theme' +html_theme_path = ["_themes", ] # Theme options are theme-specific and customize the look and feel of a # theme further. For a list of options available for each theme, see the From 5683782b0de6060976d510dbd2e31b94736b3b04 Mon Sep 17 00:00:00 2001 From: amirDahari1 Date: Tue, 14 Nov 2023 14:58:43 +0000 Subject: [PATCH 08/12] pass the sphinx readthedocs error --- docs/requirements.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 84652fb..41b7a9b 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -3,4 +3,7 @@ torch scipy matplotlib tifffile -myst_parser \ No newline at end of file +myst_parser +sphinx==5.3.0 +sphinx_rtd_theme==1.1.1 +readthedocs-sphinx-search==0.1.1 \ No newline at end of file From 83e7d201a740b56d79cc6a9524e1f1c597bfac16 Mon Sep 17 00:00:00 2001 From: amirDahari1 Date: Tue, 14 Nov 2023 15:16:47 +0000 Subject: [PATCH 09/12] to pass readthedocs build --- docs/requirements.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 84652fb..41b7a9b 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -3,4 +3,7 @@ torch scipy matplotlib tifffile -myst_parser \ No newline at end of file +myst_parser +sphinx==5.3.0 +sphinx_rtd_theme==1.1.1 +readthedocs-sphinx-search==0.1.1 \ No newline at end of file From 4e2add353396ce5065af85223179ac862c67cb77 Mon Sep 17 00:00:00 2001 From: amirDahari1 Date: Tue, 20 Feb 2024 14:10:35 +0000 Subject: [PATCH 10/12] calc vertical flux function --- taufactor/taufactor.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/taufactor/taufactor.py b/taufactor/taufactor.py index a724ac2..00db295 100644 --- a/taufactor/taufactor.py +++ b/taufactor/taufactor.py @@ -191,11 +191,16 @@ def check_convergence(self, verbose, conv_crit): self.old_fl = self.new_fl return False - def check_vertical_flux(self, conv_crit): + def calc_vertical_flux(self): + '''Calculates the vertical flux through the volume''' vert_flux = self.conc[:, 1:-1, 1:-1, 1:-1] - \ self.conc[:, :-2, 1:-1, 1:-1] vert_flux[self.conc[:, :-2, 1:-1, 1:-1] == 0] = 0 vert_flux[self.conc[:, 1:-1, 1:-1, 1:-1] == 0] = 0 + return vert_flux + + def check_vertical_flux(self, conv_crit): + vert_flux = self.calc_vertical_flux() fl = torch.sum(vert_flux, (0, 2, 3))[1:-1] err = (fl.max() - fl.min())/(fl.max()) if fl.min() == 0: @@ -286,10 +291,15 @@ def solve(self, iter_limit=5000, verbose=True, conv_crit=2*10**-2, D_0=1): self.end_simulation(iter_limit, verbose, start) return self.tau - def check_vertical_flux(self, conv_crit): + def calc_vertical_flux(self): + '''Calculates the vertical flux through the volume''' vert_flux = abs(self.conc - torch.roll(self.conc, 1, 1)) vert_flux[self.conc == 0] = 0 vert_flux[torch.roll(self.conc, 1, 1) == 0] = 0 + return vert_flux + + def check_vertical_flux(self, conv_crit): + vert_flux = self.calc_vertical_flux() fl = torch.sum(vert_flux, (0, 2, 3))[3:-2] err = (fl.max() - fl.min())*2/(fl.max() + fl.min()) if err < conv_crit or torch.isnan(err).item(): @@ -488,10 +498,15 @@ def check_convergence(self, verbose, conv_crit): return False - def check_vertical_flux(self, conv_crit): + def calc_vertical_flux(self): + '''Calculates the vertical flux through the volume''' vert_flux = (self.conc[:, 1:-1, 1:-1, 1:-1] - self.conc[:, :-2, 1:-1, 1:-1]) * self.pre_factors[1][:, :-2, 1:-1, 1:-1] vert_flux[self.nn == torch.inf] = 0 + return vert_flux + + def check_vertical_flux(self, conv_crit): + vert_flux = self.calc_vertical_flux() fl = torch.sum(vert_flux, (0, 2, 3))[2:-2] err = (fl.max() - fl.min())*2/(fl.max() + fl.min()) if err < conv_crit or torch.isnan(err).item(): From d19fdc801480cbd41a9f583829f71c43e55400f0 Mon Sep 17 00:00:00 2001 From: amirDahari1 Date: Mon, 28 Oct 2024 13:09:47 +0000 Subject: [PATCH 11/12] deleted unused variables self.ph_bot and self.ph_top --- taufactor/taufactor.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/taufactor/taufactor.py b/taufactor/taufactor.py index 00db295..51fb8cf 100644 --- a/taufactor/taufactor.py +++ b/taufactor/taufactor.py @@ -47,8 +47,7 @@ def __init__(self, img, bc=(-0.5, 0.5), D_0=1, device=torch.device('cuda')): f'Input image must only contain 0s and 1s. Your image must be segmented to use this tool. If your image has been segmented, ensure your labels are 0 for non-conductive and 1 for conductive phase. Your image has the following labels: {torch.unique(img).numpy()}. If you have more than one conductive phase, use the multi-phase solver.') # calculate - self.ph_bot = torch.sum(img[:, -1]).to(self.device) * self.bot_bc - self.ph_top = torch.sum(img[:, 0]).to(self.device) * self.top_bc + # init conc self.conc = self.init_conc(img) # create nn map @@ -350,8 +349,7 @@ def __init__(self, img, cond={1: 1}, bc=(-0.5, 0.5), device=torch.device('cuda:0 img = torch.tensor(img, dtype=self.precision, device=self.device) # calculate - self.ph_bot = torch.sum(img[:, -1]).to(self.device) * self.bot_bc - self.ph_top = torch.sum(img[:, 0]).to(self.device) * self.top_bc + # init conc self.conc = self.init_conc(img) # create nn map From bd6a245ad1c896ed90d531f8a5ad386effb8656c Mon Sep 17 00:00:00 2001 From: amirDahari1 Date: Mon, 28 Oct 2024 13:16:59 +0000 Subject: [PATCH 12/12] changed upload artifact to v3 --- .github/workflows/draft-pdf.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/draft-pdf.yml b/.github/workflows/draft-pdf.yml index e261678..ad483e7 100644 --- a/.github/workflows/draft-pdf.yml +++ b/.github/workflows/draft-pdf.yml @@ -16,7 +16,7 @@ jobs: # This should be the path to the paper within your repo. paper-path: paper.md - name: Upload - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v3 with: name: paper # This is the output path where Pandoc will write the compiled