make_filename

Issue #168 resolved
andrew_peterson repo owner created an issue

what exactly is the purpose of this function? For example, this line (which I wrote), only concatenates a string, so the call to os.path.join is not significant:

https://bitbucket.org/andrewpeterson/amp/annotate/7a3adae51cd5cd29ef54b500dfac1e038bfa6740/amp/utilities.py?at=master&fileviewer=file-view-default

We probably need to go through the code to see exactly where this is called before changing it. Note one place we need to look at is in the checkpoint saving in neuralnetwork.py.

Comments (2)

  1. Muammar El Khatib

    I used it recently for the KRR implementation I am working on for writing initial-parameters and checkpoints in the get_loss method of the KRR class. It is true that we could concatenate the label string + filename without using this function at all.

    It is called in the following files:

    amp/__init__.py:from .utilities import (make_filename, hash_images, Logger, string2dict,
    amp/__init__.py:            self._log = Logger(make_filename(self.label, '-log.txt'))
    amp/__init__.py:            filename = make_filename(self.label, '-untrained-parameters.amp')
    amp/utilities.py:def make_filename(label, base_filename):
    amp/model/neuralnetwork.py:from ..utilities import Logger, hash_images, make_filename
    amp/model/neuralnetwork.py:            filename = make_filename(self.parent.label,
    amp/model/neuralnetwork.py:                filename = make_filename(path,
    Binary file amp/model/kernel_ridge.pyc matches
    amp/model/kernel_ridge.py:from ..utilities import ConvergenceOccurred, make_filename
    amp/model/kernel_ridge.py:            filename = make_filename(self.parent.label,
    amp/model/kernel_ridge.py:                filename = make_filename(path,
    amp/analysis.py:from .utilities import now, hash_images, make_filename
    amp/analysis.py:        plotfile = make_filename(label, '-plot.pdf')
    amp/analysis.py:        plotfile = make_filename(label, '-plot.pdf')
    amp/analysis.py:        plotfile = make_filename(label, '-plot.pdf')
    
  2. Log in to comment