You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to suggest the addition of a function, to the tutorial, that performs farthest point selection for the atomic environments as one prepares for the construction of sparse kernel models. @PicoCentauri have kindly provided me with the code below, which, again, we think could be a nice addition to the tutorial:
def fps_sample_selection(descriptor, n_to_select):
blocks = []
for _, block in descriptor:
# create a separate FPS selector for each block
fps = FPS(n_to_select=n_to_select)
mask = fps.fit(block.values.T).get_support()
selected_samples = block.samples[mask]
# The only important data here is the properties, so we create empty
# sets of samples and components.
blocks.append(
TensorBlock(
values=np.empty((1, len(selected_samples))).T,
samples=selected_samples,
components=[],
properties=Labels.single(),
)
)
return TensorMap(descriptor.keys, blocks)
Thank you!
Raymond
The text was updated successfully, but these errors were encountered:
Hello,
I'd like to suggest the addition of a function, to the tutorial, that performs farthest point selection for the atomic environments as one prepares for the construction of sparse kernel models. @PicoCentauri have kindly provided me with the code below, which, again, we think could be a nice addition to the tutorial:
Thank you!
The text was updated successfully, but these errors were encountered: