Charles Jekel - jekel.meEngineer. Regression. Optimization.
https://jekel.me
Adding TensorFlow support for pwlf<p>The upcoming 0.5.0 version of <a href="https://github.com/cjekel/piecewise_linear_fit_py">pwlf</a> has introduced a number of <a href="https://github.com/cjekel/piecewise_linear_fit_py/blob/master/CHANGELOG.md">changes</a>. The most notable change is the addition of a <em>PiecewiseLinFitTF</em> object, which will be available if you have <a href="https://www.tensorflow.org/install">TensorFlow</a> installed. This post will benchmark the performance of this new object vs the older Numpy/SciPy class.</p>
Mon, 15 Apr 2019 13:00:00 +0000
https://jekel.me/2019/Adding-tensorflow-to-pwlf/
https://jekel.me/2019/Adding-tensorflow-to-pwlf/Attempting to detect the number of important line segments in data<p>There have been a number of people asking how to use <a href="https://github.com/cjekel/piecewise_linear_fit_py">pwlf</a> when you don’t know how many line segments to use. I’ve been recommending the use of a regularization technique which <a href="https://github.com/cjekel/piecewise_linear_fit_py/blob/master/examples/run_opt_to_find_best_number_of_line_segments.py">penalizes the number of line segments</a> (or model complexity). This is problematic in a few ways:</p>
<ul>
<li>It’s an expensive three layer optimization problem (least squares fit, find break point locations, find number of line segments).</li>
<li>The result will be dependant upon the penalty parameter which is problem specific. Something like cross validation could be used to select the parameter, but again this can be expensive.</li>
</ul>
Tue, 12 Mar 2019 11:20:00 +0000
https://jekel.me/2019/detect-number-of-line-segments-in-pwlf/
https://jekel.me/2019/detect-number-of-line-segments-in-pwlf/Using the validate function to compare different FaceNet models in tindetheus<p>This post will compare the results of different pre-trained <a href="https://github.com/davidsandberg/facenet">facenet</a> models when using <a href="https://github.com/cjekel/tindetheus">tindetheus</a> to build a personalized classification model for a single <a href="https://tinder.com">Tinder</a> user. Tindetheus currently states the training accuracy, recall (true positive rate), and specificity (true negative rate) after training. However, it may be more interesting to visualize the trained tindetheus models on an external dataset. The new <em>validate</em> function within tindetheus allows for a user to evaluate the trained tindetheus model on a new image database. This new function will be used to visualize the difference of using different pre-trained facenet models on a small validation dataset. While the training accuracy of the different pre-trained facenet models are subtle, the models predict different faces will be liked on a small validation dataset.</p>
Mon, 03 Dec 2018 17:00:00 +0000
https://jekel.me/2018/Validate-function-in-tindetheus/
https://jekel.me/2018/Validate-function-in-tindetheus/Battery and screen replacement on a LeEco Le Max 2 (x2)<p>I just replaced the battery and screen on my <a href="https://www.gsmarena.com/leeco_le_max_2-8051.php">LeEco Le Max 2</a>, and this post will detail the process. Hopefully it will be helpful for someone who is considering to replace their screen and/or battery.</p>
Tue, 18 Sep 2018 15:00:00 +0000
https://jekel.me/2018/How-to-Replace-battery-on-le-eco-le-max-2-x2/
https://jekel.me/2018/How-to-Replace-battery-on-le-eco-le-max-2-x2/Visual Studio Code Python Setup<p>Visual Studio Code has become my absolute favorite IDE / text editor. I highly recommend those who work with Python to consider using Code. If I were to revisit my <a href="https://github.com/cjekel/Introduction-to-Python-Numerical-Analysis-for-Engineers-and-Scientist">Python course</a>, I would spend a lecture going over setting up Code for working with Python. Microsoft has created a Python extension, which includes linting (a feature that will catch errors and help you follow the PEP 8 style guide). This post will show you how to setup code, why the linting options are useful, and how to run Python scripts from code.</p>
Sun, 29 Jul 2018 14:15:00 +0000
https://jekel.me/2018/Visual-studio-code-Python-setup/
https://jekel.me/2018/Visual-studio-code-Python-setup/512 vs 128 FaceNet embeddings on Tinder dataset<p>In <a href="https://arxiv.org/abs/1803.04347">Classifying Online Dating Profiles on Tinder using FaceNet Facial Embeddings</a> I said that the different <a href="https://github.com/davidsandberg/facenet">facenet</a> models didn’t influence the results by much. Here I’ll show by just how much different facenet models change my overall accuracy.</p>
Tue, 17 Apr 2018 13:35:00 +0000
https://jekel.me/2018/512_vs_128_facenet_embedding_application_in_Tinder_data/
https://jekel.me/2018/512_vs_128_facenet_embedding_application_in_Tinder_data/Force piecewise linear fit through data<p>I’ve received a few request for <a href="https://github.com/cjekel/piecewise_linear_fit_py">pwlf</a> to perform fits through a particular data point, or set of data points. For instance, you may know that your model must go through the origin (0, 0). We can use Lagrange multipliers to solve a constrained least squares problem to find the best piecewise linear fit while forcing the fit through a set of data points.</p>
Sun, 15 Apr 2018 23:55:00 +0000
https://jekel.me/2018/Force-piecwise-linear-fit-through-data/
https://jekel.me/2018/Force-piecwise-linear-fit-through-data/pwlf update: fitting continuous piecewise linear models to data<h1 id="pwlf-improvements-in-020-release">pwlf improvements in 0.2.0 release</h1>
<ul>
<li><strong>much faster</strong> at finding optimum break point locations due to new derivation of regression problem</li>
<li>pwlf now uses pure numpy instead of Python to solve continuous piecewise linear fit</li>
<li>new mathematical derivation (defined below)</li>
<li>pep8 style naming for class, variables, and functions</li>
<li>old naming convention still usable, but will be depreciated at some time</li>
<li>Available soon on <a href="https://github.com/cjekel/piecewise_linear_fit_py">github</a> or <a href="https://pypi.python.org/pypi/pwlf">pypi</a></li>
</ul>
Sun, 08 Apr 2018 17:20:00 +0000
https://jekel.me/2018/Continous-piecewise-linear-regression/
https://jekel.me/2018/Continous-piecewise-linear-regression/Using facenet to automatically review Tinder profiles<p><strong>tl;dr</strong> I swiped thousands of Tinder profiles so you wouldn’t have to. I used facenet to find a pattern in the Tinder profiles I liked and disliked. You can build your own models to automatically like Tinder profiles based on your historical preference using <a href="https://github.com/cjekel/tindetheus">tindetheus</a>.</p>
Wed, 28 Mar 2018 10:11:00 +0000
https://jekel.me/2018/Using-facenet-to-automatically-like-new-tinder-profiles/
https://jekel.me/2018/Using-facenet-to-automatically-like-new-tinder-profiles/Using tmpfs to speed up non-linear finite element models<p>tl;dr Use a solid-state drive (SSD) or tmpfs to speed up non-linear FE models in optimizations.</p>
Sun, 04 Feb 2018 11:52:00 +0000
https://jekel.me/2018/Using-ramdisk-to-speed-non-linear-FEA-optimization/
https://jekel.me/2018/Using-ramdisk-to-speed-non-linear-FEA-optimization/