<html><head><meta http-equiv="Content-Security-Policy" content="script-src 'self'; img-src * cid: data:;"><style id="outgoing-font-settings">#response_container_BBPPID{font-family: initial; font-size:initial; color: initial;}</style></head><body style="background-color: rgb(255, 255, 255); background-image: initial; line-height: initial;"><div id="response_container_BBPPID" style="outline:none;" dir="auto" contenteditable="false"> <div name="BB10" id="BB10_response_div_BBPPID" dir="auto" style="width:100%;"> could you provide the scikit-learn version in both case?</div> <div name="BB10" id="response_div_spacer_BBPPID" dir="auto" style="width:100%;"> <br style="display:initial"></div> <div id="blackberry_signature_BBPPID" name="BB10" dir="auto"> <div id="_signaturePlaceholder_BBPPID" name="BB10" dir="auto"><p dir="ltr">Sent from my phone - sorry to be brief and potential misspell. </p></div> </div></div><div id="_original_msg_header_BBPPID" dir="auto"> <table width="100%" style="background-color: white; border-spacing: 0px; display: table; outline: none;" contenteditable="false"><tbody><tr><td colspan="2" style="padding: initial; font-size: initial; text-align: initial; background-color: rgb(255, 255, 255);"> <div style="border-right: none; border-bottom: none; border-left: none; border-image: initial; border-top: 1pt solid rgb(181, 196, 223); padding: 3pt 0in 0in; font-family: Tahoma, "BB Alpha Sans", "Slate Pro"; font-size: 10pt;"> <div id="from"><b>From:</b> kouichi.matsuda@gmail.com</div><div id="sent"><b>Sent:</b> 17 December 2018 15:56</div><div id="to"><b>To:</b> scikit-learn@python.org</div><div id="reply_to"><b>Reply to:</b> scikit-learn@python.org</div><div id="subject"><b>Subject:</b> Re: [scikit-learn] MLPClassifier on WIndows 10 is 4 times slower than that on macOS?</div></div></td></tr></tbody></table> <br> </div><!--start of _originalContent --><div name="BB10" dir="auto" style="background-image: initial; line-height: initial; outline: none;" contenteditable="false"><div><div>
<div>
<div>
<div dir="ltr">
<div dir="ltr">Thank you for your quick reply. It's very helpful.
<div>It's because of Anaconda: Its python stops the iteration soon as follows (w/ verbose=True).</div>
<div>I am not sure why 'n_iter_no_change=10' is changed in Anaconda.</div>
<div>Anaconda might modify the MLPClassifier implementation.</div>
<div><br></div>
<div>> python <wbr><a href="http://learn.py">learn.py</a><wbr> (in pure Python+Scikit-Learn)</div>
<div>...</div>
<div>
<p class="gmail-MsoBodyText" style="margin:0mm 0mm 0.0001pt;text-align:justify;font-size:10.5pt;font-family:'century' , serif"><span style="color:black">Iteration 125, loss = 0.26152263</span></p>
<p class="gmail-MsoBodyText" style="margin:0mm 0mm 0.0001pt;text-align:justify;font-size:10.5pt;font-family:'century' , serif"><span style="color:black">Iteration 126, loss = 0.25705940</span></p>
<p class="gmail-MsoBodyText" style="margin:0mm 0mm 0.0001pt;text-align:justify;font-size:10.5pt;font-family:'century' , serif"><span style="color:black">Iteration 127, loss = 0.25957841</span></p>
<p class="gmail-MsoBodyText" style="margin:0mm 0mm 0.0001pt;text-align:justify;font-size:10.5pt;font-family:'century' , serif"><span style="color:black">Training loss did not improve more than tol=0.000100 for 10 consecutive epochs. Stopping.</span></p>
<span style="font-size:10.5pt;font-family:'century' , serif;color:black">0.8496</span> </div>
<div><br></div>
<div>> python <wbr><a href="http://learn.py">learn.py</a><wbr> (in Anaconda)</div>
<div>...</div>
<div>
<div>Iteration 23, loss = 0.34410594</div>
<div>Iteration 24, loss = 0.34663903</div>
<div>Iteration 25, loss = 0.34376815</div>
<div>Training loss did not improve more than tol=0.000100 for two consecutive epochs. Stopping.</div>
</div>
<div>0.852</div>
<div><br></div>
<div>Thanks,</div>
<div><br></div>
<div> <br></div>
<div>
<div>
<div class="gmail-m_-5585912360288482256gmail_signature" dir="ltr">---<br>松田晃一 MATSUDA, Kouichi, Ph.D.</div>
</div>
<br></div>
<br>
<div class="gmail_quote">
<div dir="ltr">2018年12月16日(日) 0:50 Gael Varoquaux <<a href="mailto:gael.varoquaux@normalesup.org">gael.varoquaux@normalesup.org</a>>:<br></div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid #cccccc;padding-left:1ex">I suspect that it is probably due to the linear-algebra libraries: your<br>scientific Python install on macOS is probably using optimized<br>linear-algebra (ie optimized numpy and scipy), but not your install on<br>Windows.<br><br>I would recommend you to look at how you installed you Python<br>distribution on macOS and on Windows, as you likely have installed an<br>optimized one on one of the platforms and not on the other.<br><br>Cheers,<br><br>Gaël<br><br>On Sat, Dec 15, 2018 at 09:02:06AM -0500, Kouichi Matsuda wrote:<br>> Hi Hi everyone,<br><br>> I am writing a scikit-learn program to use MLPClassifier to learn<br>> Fashion-MNIST.<br>> The following is the program. It's very simple.<br>> When I ran it on Windows 10 (Core-i7-8565U, 1.8GHz, 16GB) note book, it took<br>> about 4 minutes.<br>> However, when I ran it on MacBook(macOS), it took about 1 minutes.<br>> Does anyone help me to understand the reason why Windows 10 is so slow?<br>> Am I missing something?<br><br>> Thanks, <br><br>> import os import gzip import numpy as np #from <a href="https://github.com/">https://github.com/</a><br>> zalandoresearch/fashion-mnist/blob/master/utils/mnist_<wbr><a href="http://reader.py">reader.py</a><wbr> def load_mnist<br>> (path, kind='train'): labels_path = <wbr><a href="http://os.path.join">os.path.join</a><wbr>(path,'%<wbr><a href="http://s-labels-idx1-ubyte.gz">s-labels-idx1-ubyte.gz</a><wbr>'<br>> % kind) images_path = <wbr><a href="http://os.path.join">os.path.join</a><wbr>(path,'%<wbr><a href="http://s-images-idx3-ubyte.gz">s-images-idx3-ubyte.gz</a><wbr>' % kind) with<br>> <wbr><a href="http://gzip.open">gzip.open</a><wbr>(labels_path, 'rb') as lbpath: labels = <wbr><a href="http://np.frombuffer">np.frombuffer</a><wbr>(<wbr><a href="http://lbpath.read">lbpath.read</a><wbr>(),<br>> dtype=np.uint8, offset=8) with <wbr><a href="http://gzip.open">gzip.open</a><wbr>(images_path, 'rb') as imgpath: images<br>> = <wbr><a href="http://np.frombuffer">np.frombuffer</a><wbr>(<wbr><a href="http://imgpath.read">imgpath.read</a><wbr>(), dtype=np.uint8, offset=16) images =<br>> <wbr><a href="http://images.reshape">images.reshape</a><wbr>(len(labels), 784) return images, labels x_train, y_train =<br>> load_mnist('data', kind='train') x_test, y_test = load_mnist('data', kind=<br>> 't10k') from sklearn.neural_network import MLPClassifier import time import<br>> datetime print(<wbr><a href="http://datetime.datetime.today">datetime.datetime.today</a><wbr>()) start = <wbr><a href="http://time.time">time.time</a><wbr>() mlp =<br>> MLPClassifier() <wbr><a href="http://mlp.fit">mlp.fit</a><wbr>(x_train, y_train) print((<wbr><a href="http://time.time">time.time</a><wbr>() - start)/ 60)<br><br><br>> ---<br>> MATSUDA, Kouichi, Ph.D.<br><br>> _______________________________________________<br>> scikit-learn mailing list<br>> <a href="mailto:scikit-learn@python.org">scikit-learn@python.org</a><br>> <a href="https://mail.python.org/mailman/listinfo/scikit-learn">https://mail.python.org/mailman/listinfo/scikit-learn</a><br><br><br>-- <br> Gael Varoquaux<br> Senior Researcher, INRIA Parietal<br> NeuroSpin/CEA Saclay , Bat 145, 91191 Gif-sur-Yvette France<br> Phone: <a href="tel:+33169087968">++ 33-1-69-08-79-68</a><br> <a href="http://gael-varoquaux.info">http://gael-varoquaux.info</a> <a href="http://twitter.com/GaelVaroquaux">http://twitter.com/GaelVaroquaux</a><br>_______________________________________________<br>scikit-learn mailing list<br><a href="mailto:scikit-learn@python.org">scikit-learn@python.org</a><br><a href="https://mail.python.org/mailman/listinfo/scikit-learn">https://mail.python.org/mailman/listinfo/scikit-learn</a><br></blockquote>
</div>
</div>
</div>
</div>
</div>
</div></div>
<!--end of _originalContent --></div></body></html>