Skip to content

Instantly share code, notes, and snippets.

View Extraltodeus's full-sized avatar

Extraltodeus

View GitHub Profile
@Extraltodeus
Extraltodeus / consensus_merge.py
Last active November 17, 2023 09:47
the function that I mainly used to create my model
#input tensors are generally stacked layers from multiple models.
#autoweight_power will exponentially eliminate discrepancies. I used values from 2 to 16.
#proximity_power also powers the distance but at the moment of being evaluated, not after averaging. This reinforces clustered informations and can prevent discrepancies from being eliminated. Useful in some case but generally not recommanded.
#first model as ref options are better to be left alone lol. Use false.
#Also works with any tensor of course but conditionning is not that interesting with it.
def merge_tensors_by_consensus(tensors, autoweight_power, proximity_power, first_model_as_ref, first_model_as_ref_ignore, use_cuda=True):
if all(torch.equal(tensors[0], tensor) for tensor in tensors[1:]):
return tensors[0]
tensor_shape = tensors[0].shape
min_val = torch.full(tensor_shape, float("inf"))
@Extraltodeus
Extraltodeus / Cutwallpaper - Read me
Last active January 22, 2016 01:02
This script was made for triple monitor users, to automatically cut a picture in 3 equal parts, with good proportions
As far as I know you can put the .desktop file in ~/.local/share/kservices5/ServiceMenus/ if you're on Plasma 5
Don't forget to edit the commented lines if you want it to work as you wish.
The right-click function does not seem to work when there is a space in the path. Yet.