New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix error in variational_classifier.ipynb #3757

Closed
vigsterkr opened this Issue Mar 30, 2017 · 7 comments

Comments

Projects
None yet
4 participants
@vigsterkr
Member

vigsterkr commented Mar 30, 2017

[NbConvertApp] ERROR | Error while converting '/home/buildslave/nightly_default/build/doc/ipython-notebooks/gaussian_process/variational_classifier.ipynb'
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/nbconvertapp.py", line 357, in export_single_notebook
    output, resources = self.exporter.from_filename(notebook_filename, resources=resources)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/exporters/exporter.py", line 165, in from_filename
    return self.from_file(f, resources=resources, **kw)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/exporters/exporter.py", line 183, in from_file
    return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/exporters/html.py", line 65, in from_notebook_node
    return super(HTMLExporter, self).from_notebook_node(nb, resources, **kw)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/exporters/templateexporter.py", line 200, in from_notebook_node
    nb_copy, resources = super(TemplateExporter, self).from_notebook_node(nb, resources, **kw)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/exporters/exporter.py", line 130, in from_notebook_node
    nb_copy, resources = self._preprocess(nb_copy, resources)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/exporters/exporter.py", line 302, in _preprocess
    nbc, resc = preprocessor(nbc, resc)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/preprocessors/base.py", line 47, in __call__
    return self.preprocess(nb,resources)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/preprocessors/execute.py", line 145, in preprocess
    nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/preprocessors/base.py", line 70, in preprocess
    nb.cells[index], resources = self.preprocess_cell(cell, resources, index)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/preprocessors/execute.py", line 176, in preprocess_cell
    raise CellExecutionError(msg)
CellExecutionError: An error occurred while executing the following cell:
------------------
#Since inducing points are generated by random, decision boundary of SingleFITCLaplace could be different if random seed is different
np.random.seed(3)
input_path=os.path.join(SHOGUN_DATA_DIR, 'toy/banana.dat)'
n_inducing_points=8
plot_large_scale_with_inducing_points(input_path,n_inducing_points)
------------------

SyntaxError: invalid syntax (<ipython-input-15-7dcd9a5a5525>, line 4)
@minxuancao

This comment has been minimized.

Show comment
Hide comment
@minxuancao

minxuancao Mar 31, 2017

Contributor

I ran the ipython notebook in jupyter and got the following error.
screen shot 2017-03-30 at 11 13 56 pm
I think Error code(5) means access is denied somewhere but I don't know where...

Contributor

minxuancao commented Mar 31, 2017

I ran the ipython notebook in jupyter and got the following error.
screen shot 2017-03-30 at 11 13 56 pm
I think Error code(5) means access is denied somewhere but I don't know where...

@yorkerlin

This comment has been minimized.

Show comment
Hide comment
@yorkerlin

yorkerlin Mar 31, 2017

Member

@minxuancao this is not an error. It is a warning. The NLOPT minimizer stops due to some reason. The reason is coded in NLOPT. Please see the error code (e.g. 5 in this case) defined in NLOPT.

Member

yorkerlin commented Mar 31, 2017

@minxuancao this is not an error. It is a warning. The NLOPT minimizer stops due to some reason. The reason is coded in NLOPT. Please see the error code (e.g. 5 in this case) defined in NLOPT.

@deveshnag1

This comment has been minimized.

Show comment
Hide comment
@deveshnag1

deveshnag1 Mar 31, 2017

Contributor

@vigsterkr is it because of a misplace in position of " ' " in this line?
input_path=os.path.join(SHOGUN_DATA_DIR, 'toy/banana.dat)'

Contributor

deveshnag1 commented Mar 31, 2017

@vigsterkr is it because of a misplace in position of " ' " in this line?
input_path=os.path.join(SHOGUN_DATA_DIR, 'toy/banana.dat)'

@vigsterkr

This comment has been minimized.

Show comment
Hide comment
@vigsterkr

vigsterkr Mar 31, 2017

Member

@deveshnag1 most probably... then again the task is to check and solve this issue :)

Member

vigsterkr commented Mar 31, 2017

@deveshnag1 most probably... then again the task is to check and solve this issue :)

@deveshnag1

This comment has been minimized.

Show comment
Hide comment
@deveshnag1

deveshnag1 Mar 31, 2017

Contributor

@vigsterkr How do I check it? In a jupyter notebook?

Contributor

deveshnag1 commented Mar 31, 2017

@vigsterkr How do I check it? In a jupyter notebook?

@vigsterkr

This comment has been minimized.

Show comment
Hide comment
@vigsterkr

vigsterkr Apr 1, 2017

Member

@deveshnag1 i'm not so sure how you've tested that notebook as although the particular error is gone from the notebook but there's other now:

[NbConvertApp] ERROR | Error while converting '/home/buildslave/nightly_default/build/doc/ipython-notebooks/gaussian_process/variational_classifier.ipynb'
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/nbconvertapp.py", line 357, in export_single_notebook
    output, resources = self.exporter.from_filename(notebook_filename, resources=resources)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/exporters/exporter.py", line 165, in from_filename
    return self.from_file(f, resources=resources, **kw)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/exporters/exporter.py", line 183, in from_file
    return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/exporters/html.py", line 65, in from_notebook_node
    return super(HTMLExporter, self).from_notebook_node(nb, resources, **kw)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/exporters/templateexporter.py", line 200, in from_notebook_node
    nb_copy, resources = super(TemplateExporter, self).from_notebook_node(nb, resources, **kw)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/exporters/exporter.py", line 130, in from_notebook_node
    nb_copy, resources = self._preprocess(nb_copy, resources)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/exporters/exporter.py", line 302, in _preprocess
    nbc, resc = preprocessor(nbc, resc)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/preprocessors/base.py", line 47, in __call__
    return self.preprocess(nb,resources)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/preprocessors/execute.py", line 145, in preprocess
    nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/preprocessors/base.py", line 70, in preprocess
    nb.cells[index], resources = self.preprocess_cell(cell, resources, index)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/preprocessors/execute.py", line 176, in preprocess_cell
    raise CellExecutionError(msg)
CellExecutionError: An error occurred while executing the following cell:
------------------
#an example for the sonar data set
train_size=108
(x_train, y_train, x_test, y_test, B)=extract(os.path.join(SHOGUN_DATA_DIR, 'uci/sonar/sonar.all-data', train_size))
inference_methods =[
                  KLDualInferenceMethod,
                  SingleLaplaceInferenceMethod,
                  SingleLaplaceInferenceMethod,
                  KLDiagonalInferenceMethod,
                  #KLCholeskyInferenceMethod, #this method takes too long to run
                  #KLCovarianceInferenceMethod, #this method takes too long to run
                  ]

likelihoods =[
            LogitDVGLikelihood(), #KLDual method uses a likelihood class that supports dual variational inference
            LogitLikelihood(),        
            LogitVGLikelihood(), #KL method uses a likelihood class that supports variational inference
            LogitVGLikelihood(), #KL method uses a likelihood class that supports variational inference
            #LogitVGLikelihood(), #KL method uses a likelihood class that supports variational inference
            #LogitVGLikelihood(), #KL method uses a likelihood class that supports variational inference
            ]

minimizers =[
            KLDualInferenceMethodMinimizer,
            None, #using default minimizer
            LBFGSMinimizer,
            LBFGSMinimizer,
            #LBFGSMinimizer,
            #LBFGSMinimizer,
            ]

linesearches=[
            BACKTRACKING_ARMIJO,
            None, #using default line search method
            BACKTRACKING_STRONG_WOLFE,
            BACKTRACKING_STRONG_WOLFE,
            #BACKTRACKING_STRONG_WOLFE,
            #BACKTRACKING_STRONG_WOLFE,
            ]

col_size=8
lscale_min=0.0
lscale_max=5.0
lsigma_min=0.0
lsigma_max=5.0
delta=0.5
scale=5.0

lscale_list = np.arange(lscale_min, lscale_max, delta)
lsigma_list = np.arange(lsigma_min, lsigma_max, delta*scale)
lScale, lSigma = np.meshgrid(lscale_list, lsigma_list)
width=len(likelihoods)/2
f, plots =plt.subplots(width, 2, figsize=(col_size*2,col_size*width))

approx_bit_plot(inference_methods, minimizers, linesearches, likelihoods, x_train, y_train,  x_test, y_test, plots, lScale, lSigma, B)

plt.show()
------------------

AttributeError: 'int' object has no attribute 'startswith'
Member

vigsterkr commented Apr 1, 2017

@deveshnag1 i'm not so sure how you've tested that notebook as although the particular error is gone from the notebook but there's other now:

[NbConvertApp] ERROR | Error while converting '/home/buildslave/nightly_default/build/doc/ipython-notebooks/gaussian_process/variational_classifier.ipynb'
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/nbconvertapp.py", line 357, in export_single_notebook
    output, resources = self.exporter.from_filename(notebook_filename, resources=resources)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/exporters/exporter.py", line 165, in from_filename
    return self.from_file(f, resources=resources, **kw)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/exporters/exporter.py", line 183, in from_file
    return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/exporters/html.py", line 65, in from_notebook_node
    return super(HTMLExporter, self).from_notebook_node(nb, resources, **kw)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/exporters/templateexporter.py", line 200, in from_notebook_node
    nb_copy, resources = super(TemplateExporter, self).from_notebook_node(nb, resources, **kw)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/exporters/exporter.py", line 130, in from_notebook_node
    nb_copy, resources = self._preprocess(nb_copy, resources)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/exporters/exporter.py", line 302, in _preprocess
    nbc, resc = preprocessor(nbc, resc)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/preprocessors/base.py", line 47, in __call__
    return self.preprocess(nb,resources)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/preprocessors/execute.py", line 145, in preprocess
    nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/preprocessors/base.py", line 70, in preprocess
    nb.cells[index], resources = self.preprocess_cell(cell, resources, index)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/preprocessors/execute.py", line 176, in preprocess_cell
    raise CellExecutionError(msg)
CellExecutionError: An error occurred while executing the following cell:
------------------
#an example for the sonar data set
train_size=108
(x_train, y_train, x_test, y_test, B)=extract(os.path.join(SHOGUN_DATA_DIR, 'uci/sonar/sonar.all-data', train_size))
inference_methods =[
                  KLDualInferenceMethod,
                  SingleLaplaceInferenceMethod,
                  SingleLaplaceInferenceMethod,
                  KLDiagonalInferenceMethod,
                  #KLCholeskyInferenceMethod, #this method takes too long to run
                  #KLCovarianceInferenceMethod, #this method takes too long to run
                  ]

likelihoods =[
            LogitDVGLikelihood(), #KLDual method uses a likelihood class that supports dual variational inference
            LogitLikelihood(),        
            LogitVGLikelihood(), #KL method uses a likelihood class that supports variational inference
            LogitVGLikelihood(), #KL method uses a likelihood class that supports variational inference
            #LogitVGLikelihood(), #KL method uses a likelihood class that supports variational inference
            #LogitVGLikelihood(), #KL method uses a likelihood class that supports variational inference
            ]

minimizers =[
            KLDualInferenceMethodMinimizer,
            None, #using default minimizer
            LBFGSMinimizer,
            LBFGSMinimizer,
            #LBFGSMinimizer,
            #LBFGSMinimizer,
            ]

linesearches=[
            BACKTRACKING_ARMIJO,
            None, #using default line search method
            BACKTRACKING_STRONG_WOLFE,
            BACKTRACKING_STRONG_WOLFE,
            #BACKTRACKING_STRONG_WOLFE,
            #BACKTRACKING_STRONG_WOLFE,
            ]

col_size=8
lscale_min=0.0
lscale_max=5.0
lsigma_min=0.0
lsigma_max=5.0
delta=0.5
scale=5.0

lscale_list = np.arange(lscale_min, lscale_max, delta)
lsigma_list = np.arange(lsigma_min, lsigma_max, delta*scale)
lScale, lSigma = np.meshgrid(lscale_list, lsigma_list)
width=len(likelihoods)/2
f, plots =plt.subplots(width, 2, figsize=(col_size*2,col_size*width))

approx_bit_plot(inference_methods, minimizers, linesearches, likelihoods, x_train, y_train,  x_test, y_test, plots, lScale, lSigma, B)

plt.show()
------------------

AttributeError: 'int' object has no attribute 'startswith'

@vigsterkr vigsterkr reopened this Apr 1, 2017

@deveshnag1

This comment has been minimized.

Show comment
Hide comment
@deveshnag1

deveshnag1 Apr 1, 2017

Contributor

@vigsterkr It seems there was another error that I overlooked towards the end. I'll send a PR ASAP. Sorry for the mistake.

Contributor

deveshnag1 commented Apr 1, 2017

@vigsterkr It seems there was another error that I overlooked towards the end. I'll send a PR ASAP. Sorry for the mistake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment