diff --git a/GPy/core/model.py b/GPy/core/model.py
index <HASH>..<HASH> 100644
--- a/GPy/core/model.py
+++ b/GPy/core/model.py
@@ -189,7 +189,7 @@ class model(parameterised):
             start = self.extract_param()
 
         optimizer = optimization.get_optimizer(optimizer)
-        opt = optimizer(start, f_fp=f_fp,f=f,fp=fp, **kwargs)
+        opt = optimizer(start, f_fp=f_fp,f=f,fp=fp,model = self,**kwargs)
         opt.run()
         self.optimization_runs.append(opt)
now passing a reference of the model to the optimizer (used in SGD)