Lines 248-257 of neuralnetworks.py

Issue #29 resolved
Alireza Khorshidi created an issue

Comments (6)

  1. andrew_peterson repo owner

    Yes and no. I think it is useful to have a get_energy method in all of our classes to facilitate the user to "play with" the model directly; e.g., if I vary component 17 of my fingerprint how does my model's energy prediction change? That seems cleaner to do with model.get_energy(fingerprint) than with something from the outer Amp class, since it's independent of the rest.

    However, you make a good point on duplication of code. I think the standard way to handle methods that will show up in every implementation of a model is to make a parent class Model that has this and any other standard methods; then NeuralNetwork, etc., would be derivatives of this model. E.g., in model/__init__.py:

    class Model(object):
        ...
        def get_energy(self, fingerprint):
            ...
    

    and in model/neuralnetwork.py:

    class NeuralNetwork(Model):
        ...
    
  2. Alireza Khorshidi reporter
  3. andrew_peterson repo owner

    Let's think this through. Generally I think it's a good idea but we also want to be careful that we only keep a minimum standard so that people can code their own models easily.

  4. Log in to comment