@@ -217,6 +217,48 @@ def eval_descriptor(
217217 """
218218 raise NotImplementedError
219219
220+ def eval_fitting_last_layer (
221+ self ,
222+ coords : np .ndarray ,
223+ cells : Optional [np .ndarray ],
224+ atom_types : np .ndarray ,
225+ fparam : Optional [np .ndarray ] = None ,
226+ aparam : Optional [np .ndarray ] = None ,
227+ ** kwargs : Any ,
228+ ) -> np .ndarray :
229+ """Evaluate fitting before last layer by using this DP.
230+
231+ Parameters
232+ ----------
233+ coords
234+ The coordinates of atoms.
235+ The array should be of size nframes x natoms x 3
236+ cells
237+ The cell of the region.
238+ If None then non-PBC is assumed, otherwise using PBC.
239+ The array should be of size nframes x 9
240+ atom_types
241+ The atom types
242+ The list should contain natoms ints
243+ fparam
244+ The frame parameter.
245+ The array can be of size :
246+ - nframes x dim_fparam.
247+ - dim_fparam. Then all frames are assumed to be provided with the same fparam.
248+ aparam
249+ The atomic parameter
250+ The array can be of size :
251+ - nframes x natoms x dim_aparam.
252+ - natoms x dim_aparam. Then all frames are assumed to be provided with the same aparam.
253+ - dim_aparam. Then all frames and atoms are provided with the same aparam.
254+
255+ Returns
256+ -------
257+ fitting
258+ Fitting output before last layer.
259+ """
260+ raise NotImplementedError
261+
220262 def eval_typeebd (self ) -> np .ndarray :
221263 """Evaluate output of type embedding network by using this model.
222264
@@ -460,6 +502,73 @@ def eval_descriptor(
460502 )
461503 return descriptor
462504
505+ def eval_fitting_last_layer (
506+ self ,
507+ coords : np .ndarray ,
508+ cells : Optional [np .ndarray ],
509+ atom_types : np .ndarray ,
510+ fparam : Optional [np .ndarray ] = None ,
511+ aparam : Optional [np .ndarray ] = None ,
512+ mixed_type : bool = False ,
513+ ** kwargs : Any ,
514+ ) -> np .ndarray :
515+ """Evaluate fitting before last layer by using this DP.
516+
517+ Parameters
518+ ----------
519+ coords
520+ The coordinates of atoms.
521+ The array should be of size nframes x natoms x 3
522+ cells
523+ The cell of the region.
524+ If None then non-PBC is assumed, otherwise using PBC.
525+ The array should be of size nframes x 9
526+ atom_types
527+ The atom types
528+ The list should contain natoms ints
529+ fparam
530+ The frame parameter.
531+ The array can be of size :
532+ - nframes x dim_fparam.
533+ - dim_fparam. Then all frames are assumed to be provided with the same fparam.
534+ aparam
535+ The atomic parameter
536+ The array can be of size :
537+ - nframes x natoms x dim_aparam.
538+ - natoms x dim_aparam. Then all frames are assumed to be provided with the same aparam.
539+ - dim_aparam. Then all frames and atoms are provided with the same aparam.
540+ efield
541+ The external field on atoms.
542+ The array should be of size nframes x natoms x 3
543+ mixed_type
544+ Whether to perform the mixed_type mode.
545+ If True, the input data has the mixed_type format (see doc/model/train_se_atten.md),
546+ in which frames in a system may have different natoms_vec(s), with the same nloc.
547+
548+ Returns
549+ -------
550+ fitting
551+ Fitting output before last layer.
552+ """
553+ (
554+ coords ,
555+ cells ,
556+ atom_types ,
557+ fparam ,
558+ aparam ,
559+ nframes ,
560+ natoms ,
561+ ) = self ._standard_input (coords , cells , atom_types , fparam , aparam , mixed_type )
562+ fitting = self .deep_eval .eval_fitting_last_layer (
563+ coords ,
564+ cells ,
565+ atom_types ,
566+ fparam = fparam ,
567+ aparam = aparam ,
568+ ** kwargs ,
569+ )
570+ return fitting
571+
463572 def eval_typeebd (self ) -> np .ndarray :
464573 """Evaluate output of type embedding network by using this model.
465574
0 commit comments