Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deterministic subsets should use Herman's ordered subset method #4

Open
robbietuk opened this issue Apr 7, 2022 · 1 comment
Open

Comments

@robbietuk
Copy link

This method is better for reconstruction performance.

[1] G. T. Herman and L. B. Meyer, “Algebraic Reconstruction Techniques Can Be Made Computationally Efficient” IEEE Trans. Med. Imaging, vol. 12, no. 3, pp. 600–609, 1993, doi: 10.1109/42.241889.

if self.deterministic == True:
if self.subset_num != self.num_subsets:
self.subset_num += 1
else:
self.subset_num = 1

@robbietuk
Copy link
Author

Acutually, this method shouldn't use the determinisitc bool at all and instead a subset_select_function should be passed to the class

class SubsetSumFunction(AveragedSumFunction):
'''Class for use as objective function in gradient type algorithms to enable the use of subsets.
The `gradient` method is implemented in children classes and allows to return an approximation of the gradient based on subset gradients.
Parameters:
-----------
- functions: F_{1}, F_{2}, ..., F_{num_subsets}
- (optional)
subset_select_function: function which takes two integers and outputs an integer
defines how the subset is chosen at each iteration
default is uniformly at random
'''
def __init__(self, functions, subset_select_function=(lambda a: int(np.random.choice(a))), replacement = False, deterministic = False, subset_init=-1, **kwargs):

This subset_select_function should perform the deterministic subset selection methodology.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant