[SyneRBI/SIRF] Integer valued sirf.ObjectiveFunction.value (Issue #1170)

4 views
Skip to first unread message

Imraj Singh

unread,
Jan 23, 2023, 6:57:08 AM1/23/23
to SyneRBI/SIRF, Subscribed

I am reconstructing with SIRF and have only encountered integer values for sirf.ObjectiveFunction.value.

Is this expected behaviour? I could be doing something wrong, but I am not sure I am... I had a look at how it is exposed in SIRF and it seems that a float type is used, but all my values are in the format "1234567.0" with the values after the decimal non-existent...

Help would be appreciated!


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF/issues/1170@github.com>

Kris Thielemans

unread,
Jan 23, 2023, 7:09:06 AM1/23/23
to SyneRBI/SIRF, Subscribed

this is obviously a bit strange, but floats do have limited precision, and there could be some printing stuff going on.

Note that STIR uses doubles for the objective function, so if SIRF uses floats, we'd loose some precision there.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF/issues/1170/1400238671@github.com>

Imraj Singh

unread,
Jan 23, 2023, 9:13:38 AM1/23/23
to SyneRBI/SIRF, Subscribed

I have managed to reproduce this problem in the ML_reconstruction.ipynb notebook.

For the acquired_data in the notebook I multiply by an arbitrary value i.e. "100000"

image

In the reconstruction I print the objective function value:

image

As you can see there is a problem with precision it seems. I am a bit worried if the could affect gradients etc?


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF/issues/1170/1400417373@github.com>

Kris Thielemans

unread,
Jan 23, 2023, 9:39:17 AM1/23/23
to SyneRBI/SIRF, Subscribed

As you can see there is a problem with precision it seems.

Do I?

Yes, the increment is small. there's a large (and in a sense arbitrary) offset to the KL. @robbietuk created an issue UCL/STIR#697 on the offset and had a PR but ran out of steam UCL/STIR#760.

I am a bit worried if the could affect gradients etc?

the computation of the gradient is independent of the computation of the value. The latter is much more sensitive to numerical problems. (Adding lots of numbers with limited precision is tricky).

Do check if SIRF uses doubles.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF/issues/1170/1400453388@github.com>

David Atkinson

unread,
Jan 25, 2023, 4:01:58 AM1/25/23
to SyneRBI/SIRF, Subscribed

If you multiply by 1000 do you get the same effect of everything after the decimal point being zero? In that case we know it is wrong because we have seen there are more significant figures.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF/issues/1170/1403285972@github.com>

Kris Thielemans

unread,
Nov 24, 2023, 5:59:58 AM11/24/23
to SyneRBI/SIRF, Subscribed

what's the status here please?


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF/issues/1170/1825503177@github.com>

Kris Thielemans

unread,
May 29, 2024, 11:10:28 AMMay 29
to SyneRBI/SIRF, Subscribed

@Imraj-Singh this one is a bit urgent. Can you clarify if we need to fix anything?


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF/issues/1170/2137654730@github.com>

Imraj Singh

unread,
May 31, 2024, 4:39:58 AMMay 31
to SyneRBI/SIRF, Subscribed

@KrisThielemans I am not sure if the precision loss due to the KL offset will have meaningful ramifications for assessing convergence etc? I did quickly look at the source and it seems that the STIR value is case to float in SIRF: https://github.com/SyneRBI/SIRF/blob/6c7259d1e37f6112610619883c385325b2998c63/src/xSTIR/cSTIR/cstir.cpp#L1152


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF/issues/1170/2141508659@github.com>

Evgueni Ovtchinnikov

unread,
Jun 21, 2024, 6:30:30 AM (8 days ago) Jun 21
to SyneRBI/SIRF, Subscribed

Fixed now - see #1264. @Imraj-Singh Please try again.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF/issues/1170/2182482182@github.com>

Reply all
Reply to author
Forward
0 new messages