def coefficients(self): if self._coefficients is None: self._coefficients = db.get_ops_by_name(op_name="coefficients", graph_id=self.id)[0] print(self._coefficients.id) if self._coefficients.status == "computed": return self._coefficients.output else: raise Exception("Need to train the model first")
def get_ops_by_name(self, op_name, graph_id=None): ops = db.get_ops_by_name(op_name=op_name, graph_id=graph_id) return [Op(id=op.id) for op in ops]