continue_run applies adaptive_files/MLE_params.txt by position, with no check of its length or of which parameter each value belongs to

Abierto
#1,044 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
68/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
numpy, python
Área
data

Línea de trabajo

Read pybnf/algorithms/samplers/base.py around lines 371–374 and pybnf/algorithms/samplers/adaptive_mcmc.py around lines 283 and 630 to trace how MLE values are saved and loaded. Check the existing tests for continue_run and how configuration parameter names are represented. Done when loading rejects a count or name mismatch with a clear error, and a one-parameter file loads without an indexing error.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug silent-incorrectness

adaptive_files/MLE_params.txt holds values only, with no parameter names (written by np.savetxt at pybnf/algorithms/samplers/adaptive_mcmc.py:630). continue_run = 1 applies those values by position (pybnf/algorithms/samplers/base.py:371-374; adaptive_mcmc.py:283). Nothing checks the file against the configuration:

  • Too many values: an extra value is silently dropped.
  • Reordered declarations: if the uniform_var lines are reordered between runs, or the file is permuted, every chain starts from the wrong values, possibly outside the boxes, with no error.
  • One free parameter: np.loadtxt returns a 0-d array, so self.mle_start[i] should raise "too many indices". The 0-d return is confirmed; the full continue_run run is not.

#1013 covers the same problems for starting_params; this is the continue_run side. It was found in independent review of the #984 follow-ups.

Fix: write the names, and on load check the count and the names against the configuration. Refuse a mismatch, naming it.

Lenguaje dominante
Python
Estrellas
25
Forks
25
Merge medio
4 h 5 min
PR fusionados (30 d)
10

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de lanl/PyBNF

Todos los issues de lanl/PyBNF

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.