mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-04-30 23:36:23 +02:00
[pickling] load added to gpy, allows for easy loading of pickled models
This commit is contained in:
parent
aa50f1f303
commit
57e56bd93f
1 changed files with 12 additions and 0 deletions
|
|
@ -25,3 +25,15 @@ from core.parameterization import Param, Parameterized, ObsAr
|
|||
@nottest
|
||||
def tests():
|
||||
Tester(testing).test(verbose=10)
|
||||
|
||||
|
||||
def load(file_path):
|
||||
"""
|
||||
Load a previously pickled model, using `m.pickle('path/to/file.pickle)'
|
||||
|
||||
:param file_name: path/to/file.pickle
|
||||
"""
|
||||
import cPickle as pickle
|
||||
with open(file_path, 'rb') as f:
|
||||
m = pickle.load(f)
|
||||
return m
|
||||
Loading…
Add table
Add a link
Reference in a new issue