fix: Values to run ipynb correctly#1
Open
DanielGaletti wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
# Summary
Corrige erros que impediam a execução do notebook flim.ipynb no fluxo de treino e inferência.
Ajusta o pipeline de seleção/uso de labels para evitar falhas de conversão de numpy array para escalar (TypeError em model.fit).
Corrige a chamada de forward em run e o tratamento de decoder_layer=-1, além de corrigir retorno no decoder adaptativo para manter consistência de tipo (Tensor).
# What changed
pyflim/flim.py
Normalização robusta de índices/labels para escalar inteiro ao montar kernel_labels e selected_kernels_labels.
select_patches agora retorna índices planos (np.flatnonzero) em vez de arrays de shape (n,1).
run passa os argumentos corretos para forward.
forward trata decoder_layer is None ou decoder_layer == -1 como última camada da arquitetura.
pyflim/layers.py
vanilla_adaptive_decoder passa a retornar y*255 diretamente (evita torch.from_numpy em objeto já Tensor).
# Why
Esses ajustes removem falhas que quebravam o fluxo padrão do notebook:
# Impact