<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Edward Ortiz on Medium]]></title>
        <description><![CDATA[Stories by Edward Ortiz on Medium]]></description>
        <link>https://medium.com/@edward0rtiz?source=rss-97dbe9327662------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*QK4fddbztBYLoiAR2YYIAg.jpeg</url>
            <title>Stories by Edward Ortiz on Medium</title>
            <link>https://medium.com/@edward0rtiz?source=rss-97dbe9327662------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 23:28:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@edward0rtiz/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Clustering prediction tool for demand planning]]></title>
            <link>https://edward0rtiz.medium.com/clustering-prediction-tool-for-demand-planning-a11871276947?source=rss-97dbe9327662------2</link>
            <guid isPermaLink="false">https://medium.com/p/a11871276947</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[startup-lessons]]></category>
            <category><![CDATA[product-management]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[agile-methodology]]></category>
            <dc:creator><![CDATA[Edward Ortiz]]></dc:creator>
            <pubDate>Tue, 09 Feb 2021 15:47:34 GMT</pubDate>
            <atom:updated>2021-02-09T15:47:34.040Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YAnjD4Nng5olSw8TKDvutQ.jpeg" /><figcaption>Source: Kiwibot</figcaption></figure><blockquote>clustering prediction demand tool for kiwibot</blockquote><p>This blog will present the results for an MVP development for an internal tool for kiwibot to have an approach to optimize demand planning by clustering areas according to venues and traffic generated by orders.</p><p>All the screenshots contain dummy data. The purpose of this blog is that people understand some of the challenges when creating a Machine Learning product for internal processes in the company. Also, to look into insights that can serve anyone to optimize their workflow and transfer learning in the community.</p><h4>INTRODUCTION</h4><p>Kiwibot is revolutionizing the delivery service by using their robots. With more than 100k orders placed with their unique 200 robots, kiwibot optimizes local commerce, delivering safely and on time to customers.</p><p>Innovation in this industry is not easy to achieve. The delivery industry has many challenges, and for kiwibot one of their approaches is the investment in R&amp;D. One of the current tasks is to optimize the route planning for the robots. For this challenge, the team noticed it would be possible to create a tool that can profile the analytical data around the orders, the robots and see hidden patterns.</p><h4>THE PROBLEM</h4><p>With the data obtained, is easy to find hidden patterns between the orders placed and the robots in operation. One of the ideas that the data science came up to, is to create a model to optimize the group of effective placed robots that should be on field by clustering the hot zones according venue segment and traffic hour.</p><p>This proposed clusterization model also will be able to predict the areas in which these bots are going to have more deliveries so the deployment of the kiwi bots should be faster and that increases the delivery time as well reduce the operation cost of the kiwi bots by creating effective routes.</p><p>For this problem the team of Data set up a deadline of two weeks to gather the first insights.</p><h4>THE FRAMEWORK</h4><p>To achieve this goal is essential to highlight effective communication, self-management, and agile knowledge between the team members. It was established two times per week follow-up meetings to track the development of the product. After holding the meetings, a session of pair-programming and prioritizing tasks for analyzing the data were the next steps in the product development. The team also wanted to try a fast-paced framework based on the team’s practices in agile frameworks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*9xgKsf77YNO-mrsABjnY6g.png" /><figcaption>ML development cycle. Source: Jeremy Jordan</figcaption></figure><p>To summarize, the stages of this product development, once the problem was defined, were:</p><ul><li>ETL of the data by doing a deep cleansing of outliers, missing values, and string errors in some variables. The transformation of continuous variables as well as the categorical ones were performed too.</li><li>Feature engineering of the data sets by creating relevant data for further exploratory analysis and the implementation of the clusterization model</li><li>Web scraping using open street maps and foursquare to get accuracy in the coordinates of kiwibots, clients, and venues.</li><li>A/B testing the data transformed by running different logistic regression models to validate the hypothesis is viable to create a clusterization model</li><li>Implement to clusterization models one for categorical variables (k-modes) and continuous patterns (K-means)</li><li>Design a baseline frontend that the internal team could use, and the experience can fulfill the main requirements.</li><li>Design and implement the architecture for deployment (this topic will be covered below)</li></ul><p>It seems a lot to digest in 10 business days, but again, having proper self-management and proper communication, the workflow can be achieved to deploy a product or MVP in a short-time.</p><h4>THE SOLUTION</h4><p>In the ETL process, an exploratory analysis of data was performed to find hidden patterns in the data and create a section of EDA plots that shows relevant data for the sales team and the operations team.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ApJAnnCulCXjGcVpsy8B0A.png" /></figure><p>For the clusterization model, the technique used was K-means. This unsupervised machine learning algorithm may be used to find clusters of information that share similar attributes and classify them into individual categories. The algorithm works by creating a set number of clusters from the data points as defined by the user. The algorithm then iteratively tries to find the optimum centroid to classify the data points.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lNS2QWZFtqvvHo_f9xDitA.png" /></figure><p>To decide if K-means were the proper approach to predicting clusters, the EDA (exploratory data analysis) helped find a correlation between categories such as the location frequency, order prices, and delivery time. Also, when implementing the K-means algorithm, the elbow technique was implemented. Elbow runs the k-Means algorithm for a range of K values until it finds an inflection point interpreted as the optimum K value.</p><h4>THE ARCHITECTURE</h4><p>Today many third parties-providers can create analytical dashboards. However, as part of the machine learning product development, this tool was built from scratch, so the company will have a custom analysis of the data and do not be limited to a third-party tool.</p><p>The next image shows the initial architecture of this tool as part of a microservice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MkrbVo-2-VTPFopf-MwUMw.png" /><figcaption>KAD achitecture</figcaption></figure><h4>THE RESULTS</h4><p>This tool named KAD (Kiwibot Analytics Dashboard) developed for kiwibot is in the first stage. The findings supported the initial hypothesis, and the clusters encountered proved that the kiwibot planning route is well defined in the first cluster. However, there is an opportunity to improve the kiwibots on the field in the second cluster. That cluster contains a large set of venues with regular orders created that the kiwibots can handle to cover the high demand in that area.</p><p>We also found the clusters are eligible for Kiwibots to operate in larger areas, thus covering more orders; midday is a time zone that could be reinforced by making more demands, and KAD will serve to develop strategics to the sales team as well as the operation teams.</p><h4>NEXT STEPS</h4><p>The KAD tool successfully achieved the goal based on the adjusted timeline, and indeed some improvements have to be made for the next stage:</p><ul><li>Optimize the data storage by merging the databases into the microservice developed and not using an S3 storage</li><li>Experimenting with other clusterization models. It was discussed to implements a DBSCAN and a grid-based model</li><li>Move the single microservice architecture into the current stack used by the company.</li></ul><h4>FINAL REMARKS</h4><p>Thanks to <a href="https://www.linkedin.com/in/afroserom/">Andres Rosero</a> Head of Data, <a href="https://www.linkedin.com/in/davidrodriguezac/">David Rodriguez</a> Head of Business at Kiwibot, for jump in this project, <a href="https://www.linkedin.com/in/emetricz/">Mario Morales</a> SWE-ML at Holberton School; and <a href="https://www.linkedin.com/in/carlos-molano-salazar/">Carlos Molano</a> SWE at Globant.</p><p>This blog is not a sponsored post. However, it is remarkable that at kiwibot, part of company innovation is based on the transfer learning between team members and the community by stepping up into fast, scalable ideas.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a11871276947" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Augmentation under 2 min with Tensorflow]]></title>
            <link>https://edward0rtiz.medium.com/data-augmentation-under-2-min-with-tensorflow-8e8dd0f336d4?source=rss-97dbe9327662------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e8dd0f336d4</guid>
            <category><![CDATA[image-classification]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-visualization]]></category>
            <dc:creator><![CDATA[Edward Ortiz]]></dc:creator>
            <pubDate>Tue, 24 Nov 2020 01:28:16 GMT</pubDate>
            <atom:updated>2020-11-24T01:28:16.617Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q6TktgxefgvP3jQEoJuJgQ.png" /><figcaption>Data augmentation sample. credits: My pet</figcaption></figure><blockquote>A baseline approach to automate data augmentation using Tensorflow</blockquote><p>In Machine Learning the need to work with a large amount of data to create the most reliable experiments by training a meaningful quantity of samples is a common practice in the industry. However, there are situations when the user does not have enough data to create a good ML model, so there is when certain techniques come to a place to expand the size of a training data set.</p><p>For example, let’s imagine that a Deep Neural Network is a car that needs to get to a certain destination, and to get this done, you need to add enough gas to the car. This gas can be seen as the amount of data required for the model. Then as you can see there is an analogous relation between the model and the amount of data so the model can perform well.</p><blockquote>The amount of data required is proportional to the number of learnable parameters in the model</blockquote><p>Data Augmentation is one technique in machine learning that apply different transformations on the available data to synthesize new data, thus expanding the amount of data so the model can work properly. Taking the example of a Deep Neural Network, the model trained to achieve high performance on complex tasks generally have a large number of hidden neurons. As the number of hidden neurons increases, the number of trainable parameters also increases.</p><p>Taking the example of an image classification application, the performance of a model without augmentation can be 57%, but when implementing data augmentation, the performance can increase up to 78%. Data augmentation can be applied using regular transformation or GANs techniques and can be applied not only to image classification but to text classification as well.</p><p>With Tensorflow 2.3.0, data augmentation can be an automated process that can be achieved by doing the following steps:</p><h4>Step 1</h4><p>Import tensorflow and optional tensorflow_datasets to play with random data</p><pre>import tensorflow as tf<br>import tensorflow_datasets as tfds<br>import matplotlib.pyplot as plt</pre><h4>Step 2</h4><p>Load the dataset</p><pre>doggies = tfds.load(&#39;stanford_dogs&#39;, split=&#39;train&#39;, as_supervised=True)</pre><h4>Step 3</h4><p>Use the module tf.image + the modification you want. Check more in the tf <a href="https://www.tensorflow.org/api_docs/python/tf/image">documentation</a></p><pre><strong>def</strong> flip_image(image):   <br>   &quot;&quot;&quot;flip image&quot;&quot;&quot;    <br>   flip = tf.image.flip_left_right(image)    <br><strong>return</strong> flip</pre><h4>Final remarks</h4><p>Simple as that you can create augmented data and expand the size of your dataset if working with images. I encourage you to check the module tf.image and use all the different methods allowed so next time you don’t see that augmented data technique is a difficult thing to handle</p><h3>References</h3><p><a href="https://www.tensorflow.org/api_docs/python/tf/image">Module: tf.image | TensorFlow v2.12.0</a></p><iframe src="https://drive.google.com/viewerng/viewer?url=https%3A//arxiv.org/pdf/1609.08764.pdf&amp;embedded=true" width="600" height="780" frameborder="0" scrolling="no"><a href="https://medium.com/media/13373875354b9e5003050c3b7fd48d4c/href">https://medium.com/media/13373875354b9e5003050c3b7fd48d4c/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e8dd0f336d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Time series forecasting of exchange currency with Tensor Flow]]></title>
            <link>https://medium.com/analytics-vidhya/time-series-forecasting-of-exchange-currency-with-tensor-flow-f475927a68b8?source=rss-97dbe9327662------2</link>
            <guid isPermaLink="false">https://medium.com/p/f475927a68b8</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[time-series-forecasting]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[neural-networks]]></category>
            <dc:creator><![CDATA[Edward Ortiz]]></dc:creator>
            <pubDate>Mon, 21 Sep 2020 05:35:19 GMT</pubDate>
            <atom:updated>2020-09-21T16:10:43.061Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Case of study for the single step implementation of a time series forecast model using RNN-LSTM.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_9wBxiZJ35l8bDXpu5c0Nw.jpeg" /><figcaption>Image credit: <a href="https://www.raconteur.net/">r</a>aconteur.net</figcaption></figure><p>In this article, we will cover the concept of time series but injecting some machine learning into this. At the end of this reading, I promise you will feel more attracted to machine learning and how you can apply time series forecasting with any neural network model, and who knows? maybe you will be the next wolf of wall street by predicting prices in stocks, ETF’s, currency exchange, and more.</p><p>If you are new into machine learning feel free to read some of my previous <a href="https://medium.com/@edward0rtiz">articles</a> were I explain comprehensively some complex topics in a way you can understand without feeling frustrated.</p><h4>The basics</h4><p>Time series is <em>An ordered sequence of values of a variable at equally spaced time intervals</em>. The applications of time series are now wide common but mostly these models seek to obtain an understanding of the underlying forces and structure that produced the observed data and fit a model and proceed to forecasting, monitoring, or even feedback and feedforward control.</p><blockquote><em>Time series analysis accounts for the fact that data points taken over time may have an internal structure (such as autocorrelation, trend, or seasonal variation) that should be accounted for.</em></blockquote><h4>The context</h4><p>Having defined the concept of time series is time to look at what of these models machine learning applications can fit to enhance a time series forecasting. One of the main advantages to apply neural networks techniques to real problems is that we can generate a model that can be trained by itself, and not be limited by a specific range of data. In other words, our model can receive as many parameters as we want as long as our computational expense can be sustained by a machine.</p><p>Another advantage to use neural networks in time series is that the input is stored in the own network instead of a database so the loss of data won’t be affected. The most common neural networks that can implement a time series prediction are the convolutional neural networks, deep neural networks, and recurrent neural networks.</p><p>Another particular aspect when working with ANN (artificial neural networks) is that when doing forecasting the model can be trained under a method called a single feature, in which the mode is going to perform training and prediction of one variable vs multiple variables. This one to many evaluations is the first step when implementing an ANN for time series. If you want to take the model to another step the other technique is doing forecasting by multiple steps.</p><p>Multiple steps forecasting with ANN can perform a single shot prediction of all the parameters at once. For example, in a forecast for a logistics company, the model intends to forecast a correlation of multiple variables e.g. supply, demand, stock, production at the same time, and between them. It may seem unnecessary or incoherent, but depending on the problem to solve, time forecasting with ANN using multiple steps can give specific insights that a traditional model can deliver, and even more, it can make one prediction at a time and feed the output back to the model.</p><h4>The problem</h4><p>Bitcoin is surrounded by mystery on who created this digital currency; also, it is a highly volatile asset, and some governments still deny the use of this currency for their model of decentralization commerce. Nevertheless, the hype and the same fact of being a decentralized currency has maintained this digital currency alive, and now banks are investing in it and started adopting it to offer bitcoin-related services.</p><p>In 2018 Bitcoin peaked with the transaction price and many people started to see the way to know more about the trend of this currency to invest and win a large profit over that investment. We are going to use a dataset from coinbase.com of the historical data by the minute of the bitcoin BTC transaction in USD Dollars from 2017 to 2020. Based on that, we are going to use an ANN to predict based on the last 24 hours the close price of the next hour of the BTC.</p><h4>EDA and Data Engineering</h4><p>The data set from coinbase contains around 1.485.982 million records distributed at the open price, close price, high, low volume in BTC, volume in USD, weighted price, and transaction time in one minute. This is a lot of data, and we need first to make an exploration of that data to gather as much accurate information of the data.</p><p>By making this EDA (Exploration Data Analysis), a lot of NaN values were found, but those NaN values belonged to the first four years in which the bitcoin was not that popular as today. Therefore, taking this into account the first step of handling this data is to use the records from 01–01–2017 until the last date 02–02–2020.</p><p>Because the problem intends to forecast each hour the close price of BTC based on the last 24 hours, the data is going to take into account each hour from 01:00:00 to 00:00:00. This will also reduce the dataset but the number of records will not affect the performance of the model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*jgiA4TdtToyoM87yzjDilA.png" /><figcaption>Table 1: EDA basic data of coinbase</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*m_6MMg5Y0IZfM9IabZdXtw.png" /><figcaption>Line plot: time series per hour BTC</figcaption></figure><p>At this stage, any other exploration is possible to do from a correlation heat map, to distribution analysis to identify other patterns that can serve to train a real ANN model.</p><h4>Setting up the model: data splitting &amp; normalization</h4><p>Once performed the initial exploration cleaning of the data, it is time to decide what will be the final data to put into the neural network model. In this case, it was dropped the column of volume currency due it was the one with less correlation with the other variables. The new total of parameters to be evaluated with the neural network model is 17.687.</p><p>The split data process for the model was to choose 70% of the total data to be trained, 20% for validation, and 10% for the test data. This proportion is a standard one, but in case you want to work with an 80% — 20% ratio, it is possible to do it. The final amount of parameters to be trained is:</p><pre>column_indices = {name: i <strong>for</strong> i, name <strong>in</strong> enumerate(df.columns)}<br>n = len(df)<br>train_df = df[0:int(n*0.7)]<br>val_df = df[int(n*0.7):int(n*0.9)]<br>test_df = df[int(n*0.9):]</pre><ul><li>Train set: 12380 parameters with six labels</li><li>Valid set: 3538 parameters with six labels</li><li>Test set: 1769 parameters with six labels</li></ul><p>Also, it is important to scale the data (normalization process) this can be done by subtracting the mean and dividing it by the standard deviation.</p><pre>train_mean = train_df.mean()<br>train_std = train_df.std()<br>train_df = (train_df - train_mean) / train_std<br>val_df = (val_df - train_mean) / train_std<br>test_df = (test_df - train_mean) / train_std</pre><p>This graphic shows that only the Volume_BTC column has a long tail, but this feature is not the most relevant one so it will not affect the training of the model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*BPbzgtikwJ9MAtANP2wqzw.png" /><figcaption>Violin plot of normalized dateset BTC</figcaption></figure><h4>Forecasting with TF: Introducing Data Windowing</h4><p>Once having the data set, split, and normalized, the next step is to define the variable to be evaluated in a single step model. For the time series forecasting, the library to do this implementation is tensor flow, using a process called Data windowing needs to be done first.</p><p>Data windowing is to create a window (array) then will contain the number of steps (width) of the features. That means that if we are going to predict the close price of BTC each hour taking the last 24h transaction record, the width is going to be 24. The following graphical example can give an intuition of this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/438/1*zxEiN4LlXQToZaEM9v_DSA.png" /><figcaption>window that makes a prediction 1h into the future, given 6h of history. Image credit: TensorFlow.org</figcaption></figure><pre>w1 = WindowGenerator(input_width=24, label_width=1, shift=1,                      label_columns=[&#39;Close&#39;]) w1<br>Total window size: 25<br>Input indices: [ 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23]<br>Label indices: [24]<br>Label column name(s): [&#39;Close&#39;]</pre><p>This piece of code shows the output of implementing the data windows taking the main feature (Close price) as the column label.</p><p>By identifying the window that we have to construct, the next step is to split the window into pairs of features and labels. To achieve this, the most efficient way is to create a python class named Windows Generator and then generate batches of these windows from the training, evaluation, and test data, using tf.data.Dataset.</p><p>Also, two methods were created, split_window and make_dataset. Both of them serve for handling the label_columns generated in the windows generator function so it can serve useful to a single-step method training with the ANN.</p><p>Finally, the model and is going to compute three different scenarios in which the prediction will take place</p><h4>Implement the architecture in a single step model RNN-LSTM</h4><p>Recently, for a business decision, logistic monitoring, and financial prediction amidst other uses, the complexity of forecasting problems required clever solutions to heads up with these problems. With the continuous improvement of ANN models and properly applying them, a robust alternative is now available to predict accurately and extract unseen features and relationships in this kind of time series problems.</p><p>The chosen ANN for this example was an RNN using an LSTM network. This network is similar to an RNN (recurrent neural network); the big difference is that LSTM (Long Short-Term Memory) is a modified version of an RNN, allowing to remember past data easily. LSTM is popular to predict time series given time lags of unknown duration. The training process is done by using back-propagation. Below a diagram of an RNN-LSTM</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J5W8FrASMi93Z81NlAui4w.png" /><figcaption>LSTM diagram Image credit: <a href="https://github.com/mahnerak">mahnerak</a></figcaption></figure><p>For this implementation, the model will consist of a 16 units layer LSTM architecture, optimized with ADAM. Because there is a window generated, (24h step), this window will be the input of the dimensions in the cells of the network. Also, the model will have a dense layer for the output of the prediction.</p><p>Finally, a callback was selected to save the loss MSE (mean squared error) and to gather the most accurate prediction point based on the smallest error possible of the complete training in the valid set.</p><h4>Baseline result</h4><p>The baseline result is the time series forecasting of the data set without any ANN model implemented. The absolute error of this training was 0.0051. To understand these diagrams, see the pattern between the label points and the predictions. When both data points are connected between themselves, it means the close price of that data point will be occur based on the MSE computed.</p><p>However, the patter of the three different scenarios is different. A way to improve this is to merge the three predictions into a single line plot to see which point is most likely to connect, and that should be the investment momentum (the prediction) of the model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/1*akeM0kfpFsz70NU6cC7GpQ.png" /><figcaption>Baseline Time series forecasting BTC predictions</figcaption></figure><h4>RNN-LSTM result</h4><p>The ANN model used for this forecasting got a result of 0.089. There is not a considerable difference compared to the baseline model except for the third line plot where the train of the BTC is not relevant. The hypothesis on this situation is due to some of the inputs are not higher correlated with the close of BTC (parameter defined for prediction) so, when normalizing the data, some outliers affected this training. You can remove those columns that do not have good correlation or none correlation at all but, the idea of this technique is to create a prediction based on the evaluation of multiple variables with the Close price of BTC.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*M0dX99nyJcsEgva-SX828Q.png" /><figcaption>RNN-LSTM Time series forecasting BTC predictions</figcaption></figure><h4>Performance of the model</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/542/1*nA5Y5H0NNlMQRJ_wcfTzTA.png" /><figcaption>Performance Baseline vs RNN-LSTM BTC</figcaption></figure><p>The baseline model with no ANN implementation on it got a better score of loss MSE with 0.0051. Contrarily the RNN-LSTM loss was 0.0089 in both models exceed in performance and notice that the RNN-LSTM is a much more complex model that takes into account the regression of multiple variables. Therefore, the small difference of loss respects the naive implementation.</p><p>The idea to have both models compared is to understand the behavior between a traditional implementation versus a machine learning approach and based on both models to create a strategy that can fulfill the forecast decision, in this case, the advanced purchase decision of bitcoins in a future of 24 hours.</p><h4>Final thoughts</h4><p>Time series forecasting is a hot topic these days, and people seem that mastering this technique will be the dream job, and be like the wolf of wall street. However, time-series prediction still has limitations; the forecasting with a naive implementation of a machine learning approach will compute the data of the historical record entered in the model. In a real-life scenario, that in the case of the stock market or currency market, volatility is wild, is a kind of entropy that its quite hard to measure for this specific case. So anything new that happens outside the environment created to train a model of forecasting will have a different output than the one predicted.</p><p>I hope you liked this fun article, and if you get rich with this, buy me a coffee and why not? donate me a bitcoin I will be motivated to do more crazy prediction using ML</p><h4>Skimming the code</h4><p>Feel free to use the code of this example and try to understand the intuition so you can implement by yourself tie series forecasting into currencies, ETF’s or stocks.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1fdfb5826742fbe04d4aad1ddfc114f9/href">https://medium.com/media/1fdfb5826742fbe04d4aad1ddfc114f9/href</a></iframe><h4>References</h4><ul><li><a href="https://arxiv.org/abs/1909.09586">Understanding LSTM -- a tutorial into Long Short-Term Memory Recurrent Neural Networks</a></li><li><a href="https://github.com/keras-team/keras/issues/7600">LSTM input mapping · Issue #7600 · keras-team/keras</a></li><li><a href="https://www.tensorflow.org/tutorials/structured_data/time_series">Time series forecasting | TensorFlow Core</a></li><li><a href="https://itl.nist.gov/div898/handbook/pmc/section4/pmc41.htm">6.4.1. Definitions, Applications and Techniques</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f475927a68b8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/time-series-forecasting-of-exchange-currency-with-tensor-flow-f475927a68b8">Time series forecasting of exchange currency with Tensor Flow</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Achieve Bayesian optimization for tuning hyper-parameters]]></title>
            <link>https://medium.com/analytics-vidhya/achieve-bayesian-optimization-for-tuning-hyper-parameters-df1aad6cb49a?source=rss-97dbe9327662------2</link>
            <guid isPermaLink="false">https://medium.com/p/df1aad6cb49a</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Edward Ortiz]]></dc:creator>
            <pubDate>Wed, 26 Aug 2020 15:57:57 GMT</pubDate>
            <atom:updated>2020-08-27T12:24:14.817Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>A comprehensive guide to understanding hyper-parameter optimization using Bayesian optimization with GPyOpt library in deep neural networks</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*72Ayj_X1BTNIYEkMokgnDA.png" /><figcaption>Image credit: Scott Adams</figcaption></figure><p>If you are new into the machine learning or deep learning field I suggest you read first some of my previous <a href="https://medium.com/@edward0rtiz/machine-learning-101-part-2-366bb5607ef8"><em>articles</em></a> in which I give an approach to some of the concepts covered here. Nevertheless, if you want to have fun and get your mind blown for the next couple minutes sit and let’s start this journey in the machine learning field</p><h3><strong>The recap</strong></h3><p>The first time I started to work with neural networks I used to tune hyperparameters of my machine learning model based on trial and error or based on what other peers found in their tuning. However, what if you want to have more control over your neural network model and search for a value that can reduce your uncertainty to achieve a reliable accuracy with your data?</p><p>Indeed this question is attractive when designing and implementing your neural network and maybe you will think “I want to do this but it seems hard”. Well, partially it is. But, in this article, we are going to have a friendly approach on how to achieve the hyper-parameter optimization and not fail in the way. Once you understand this, believe me, either this technique or other technique you want to use for optimizing hyper-parameters, it will become your best friend to succeed in building better neural networks.</p><h4>What are hyper-parameters?</h4><p>When you build a neural network to address a practical problem you came across a concept called hyper-parameters. Depending on how your tune these parameters your network will give you an approximation on your target accuracy or not. Think in parameters as variables that determine your network structure and how it will be trained. e.g how many layers does your neural network will have? does my network will have a learning rate variable when it’s being trained?</p><p>Despite the definition of hyper-parameter may sound simple it is important to notice that these are different from the model parameters. The model parameters are the properties of the training data that are learned during training by the classifier or other machine learning models. e.g. for a neural network the weights of the connections in the model are parameters because they differ for each experiment and depend on the type of input data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*WPU7cF54O1x3IovALwMR2Q.png" /><figcaption>hyper-parameters. deeplearning.ai</figcaption></figure><p>Whereas the hyper-parameters are those that cannot be learned during training but are set beforehand. e.g in a neural network the number and size of the hidden layers, weight initialization, learning rate, dropout, and gradient, batch size can be defined as hyper-parameters.</p><p>You can choose for tuning some hyper-parameters so your model can be trained and evaluated correctly. There is no best — worst hyper-parameter, you just need to test which one affects in high proportions your model and consequently, over-fit/under-fit your data, to have noisy data or even a not suitable structure.</p><h3>The techniques</h3><p>Once identified what are the hyper-parameters in your machine learning model, now you can take three approaches:</p><ol><li>Choose the hyper-parameters based on the previous tuning of other models you used.</li><li>Tune your hyper-parameters based on other successful implemented models</li><li>Find out which are your best tuning values for your specific model.</li></ol><p>From these three options, the best one to choose is the third one based on the assumption that your model is never going to be the same like other neural network models, unless you decide to work with the same data set, network structure and address the same problem of that model.</p><p>After, following the path for search which are the best hyper-parameters and what are going to be the optimal tuning values of these parameters, the next step is to select which tool to implement to assess this problem. The following are the most used techniques for hyper-parameter optimization:</p><ol><li><em>Manual Search</em></li><li><em>Grid Search</em></li><li><em>Random Search</em></li><li><em>Bayesian Optimization</em></li></ol><h3>Implementing the optimization technique</h3><p>Following this scenario and according to the title of this article, the tool selected for tuning and optimizing the hyperparameters for a neural network model is going to be the Bayesian optimization.</p><h4>The Gaussian Process</h4><p>Before stepping into the practical Bayesian optimization implementation for the neural network example, it is important to define briefly the Gaussian process concept. The Gaussian process is a generalization of the Gaussian probability distribution. Whereas a probability distribution describes random variables which are scalars or vectors (for multivariate distributions), a stochastic process governs the properties of functions.</p><p>Think of a function as a very long vector and each entry in the vector specifying the function value <em>f(x)</em> has a particular input <em>x</em>. Now, if you are working in a NN model, you also realize that for example computing the layers of that model is going to be computationally expensive to get the best value for a tune in the hyper-parameter.</p><blockquote>Then, the Gaussian process framework is tractability enabling hardcore computational work in a NN. The formal definition of a Gaussian process is: “a collection of random variables, any finite number of which have (consistent) joint Gaussian distributions.”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/329/1*Ap0-o5TvcdGKREds4BP_BQ.png" /><figcaption>Gaussian process formula</figcaption></figure><p>The formula above is defined as <em>f </em>being<em> </em>the function distributed as a <em>GP</em> with a mean function <em>m</em> and covariance function <em>k</em>. This covariance function is also known as the kernel function which determines almost all the generalization properties of a GP and it can be defined as the similarity score between two objects.</p><h4>Bayesian Optimization</h4><p>Bayesian optimization is a technique that comes from the Bayes theorem and their approach to stochastic processes for measure variables counting their event probability and event of uncertainty.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*tWTL2w8duqJA5dlNwXK88Q.jpeg" /><figcaption>Bayes-theorem</figcaption></figure><p>This technique can be seen as a surrogate of the Gaussian process. Also, Bayesian optimization enables a short search time for a complex prediction model that includes many hyper-parameters while maintaining the accuracy of the prediction model.</p><blockquote><em>The Bayes theorem, in essence, states: (simplifying somewhat) that the posterior probability of a model (or theory, or hypothesis) </em><strong>M</strong><em> given evidence (or data, or observations) </em><strong>E</strong><em> is proportional to the likelihood of </em><strong>E</strong><em> given </em><strong>M</strong><em> multiplied by the prior probability of </em><strong>M: P(M|E) ∝ P(E|M)P(M)</strong></blockquote><p>When having an optimization problem in machine learning, Bayesian optimization handles the <strong><em>f(x)</em></strong> function as a black box. This black box term comes from the definition in computing science of having an object which can be viewed in terms of its inputs and outputs, without any knowledge of its internal workings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*fwD5i5m9Gr94u5pFbY1IJw.png" /><figcaption>Black-box diagram example</figcaption></figure><p>So, when looking at the example of a NN, the <em>f(x)</em> function does not have an analytical expression, and the evaluation of the function is restricted to sampling at a point x and getting a possible response.</p><p>Another thing to consider in the Bayesian optimization technique is that we need to propose sampling points to start the exploration in the algorithm. This is known as the<em> acquisition function which are heuristics for how desirable it is to evaluate a point, based on our present model</em></p><blockquote>The idea with Bayesian optimization is to construct another model of the search-space for hyper-parameters.</blockquote><p>By this point we can infer that Bayesian optimization attempts to find the global optimum in a minimum number of steps too, it is the moment to move into practical implementation.</p><p>The following image presents the algorithm implementation of this technique.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*CnP4JS-JCNUMfn2NicWEdQ.png" /><figcaption>Image credit. Eric Brochu, Vlad M. Cora and Nando de Freitas</figcaption></figure><p>I strongly recommend that if you want to know more about the mathematical intuition of this hyper-parameter optimization technique check the article <a href="https://arxiv.org/abs/1012.2599"><em>“A Tutorial on Bayesian Optimization of Expensive Cost Functions, with Application to Active User Modeling and Hierarchical Reinforcement Learning”</em></a><em> . </em>Whereas this article is intended to give you the motivation to enhance your workflow in modeling machine learning models, and by having today powerful tools like GPyOpt, Scikit-opt and others, if you get to understand the math intuition of this concept believe your criteria decision of tuning hyper-parameters will be even more effective by implementing either Bayes optimization or other technique</p><h3>Implementation of Bayes optimization for a neural network</h3><p>Having the basic understanding of the Bayes optimization and some of the conceptual intuition of how this technique works, now is time to implement it in a NN and see the results.</p><p>For a NN scenario, we are going to use a simple NN model using the MNIST data set. The table below shows the base model. At this point, the next step is to start the training by modifying the hyper-parameters applying Bayesian optimization to find out what is the best configuration for these hyper-parameters for an optimal accuracy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*RGR22BxiRYwHcuLlMfdZKA.png" /></figure><p>In this example they were taken 5 hyper-parameters to be evaluated; L2 regularization, layers in the NN, batch size of the network, dropout, and finally the learning rate. To initialize the Bayesian optimization, it is necessary to insert two initial samples X_init and Y_init so the algorithm can start iterating n times over a given bound for each hyper-parameter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*Jn-78KoxAqhl82092pNLLA.png" /></figure><p>By using the library GPyOpt the Bayesian optimization is performed and the result of this optimization will store the which hyper-parameters provided the best accuracy for the given model. It is important that this technique also can be modified to be optimized in function of the valid loss, meaning that the Bayesian optimization will perform the optimization of the hyperparameters for a model which their loss is the lowest.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*vGJdrgeDL6CBf2fuLvksSQ.png" /></figure><p>The chart with a red line shows the distance of the x’s values (hyper-parameters) evaluated in each iteration. This means that the algorithm took in a defined range x points of the batch size of the trained model and started their evaluation of the accuracy of the model. Remember that this example is used in the f(x) with 5 hyper-parameters to be evaluated. However, the distance is not giving enough information about our optimized hyper-parameters.</p><p>Then, by looking at the right chart, the behavior of this chart is the accuracy given the optimized hyper-parameters with the Bayes optimization technique. That means, that after 5 iterations with the Bayes optimization technique the accuracy had minor changes in their accuracy but to know more information about which model is the best a report can be saved like the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*IxNG4yg0K0vQ0RiXPndHtg.png" /></figure><p>This is the report that GPyOpt prints given insight data of the optimization process, where the best accuracy and the best hyper-parameters are located at the summary section at the end of the report. Also, in this example, a friendly custom report is printed so the user can see the best values of the Bayesian optimization after the process is completed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*7THRf9Ggjtyj9u6Cjdg6nw.png" /></figure><h3>Final thoughts</h3><p>Hyper-parameter optimization is a practice computationally expensive, but once you can master it, will give you better insights about the development of your models, I said at the beginning of this article that a machine learning engineer will face unique individual problems with unique data. By implementing these techniques, not only the model but the results of this trained and evaluated model will reduce the uncertainty factor and the development of strategies based on an accurate model with accurate hyper-parameters is more reliable than a model with a random tuning hyper-parameter.</p><p>There are many techniques for hyper-parameter optimization, Bayesian optimization is one of them could be one of the most complexes but I hope with this explanation you are motivated to give it a try and understand not only the mathematical intuition behind this method but the positive results you can have by using this specific technique.</p><p>Finally, the last image is a flowchart developed by Magnus Erik Hvass Pedersen and it describes quite well the behavior of hyper-parameter optimization in the Gaussian process, but remember that Bayesian optimization is a surrogate of the GP, so this flowchart will aid to the understanding of this the Bayesian optimization technique.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*2rggEZnIerwTV4i--D4edA.png" /><figcaption>Flowchart of hyper-parameter optimization. Image credit: Hvass-Labs</figcaption></figure><h3>Bonus</h3><p>If you want to know more how the code for the presented example, I will share the code below so you can play with it.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/82069ae9609bc46d22a57566bfb0c7fe/href">https://medium.com/media/82069ae9609bc46d22a57566bfb0c7fe/href</a></iframe><h3>References</h3><ul><li><a href="https://arxiv.org/abs/1012.2599">A Tutorial on Bayesian Optimization of Expensive Cost Functions, with Application to Active User Modeling and Hierarchical Reinforcement Learning</a></li><li><a href="https://www.cs.toronto.edu/~duvenaud/cookbook/">Kernel Cookbook</a></li><li><a href="http://www.gaussianprocess.org/gpml/chapters/">Gaussian Processes for Machine Learning: Contents</a></li><li><a href="https://github.com/Hvass-Labs/TensorFlow-Tutorials/blob/master/19_Hyper-Parameters.ipynb">Hvass-Labs/TensorFlow-Tutorials</a></li><li><a href="https://distill.pub/2020/bayesian-optimization/">Exploring Bayesian Optimization</a></li><li><a href="http://krasserm.github.io/2018/03/19/gaussian-processes/">Gaussian processes</a></li><li><a href="https://medium.com/@edward0rtiz/machine-learning-101-part-2-366bb5607ef8">Machine Learning 101 part 2</a></li><li><a href="https://www.linkedin.com/in/ortizedward/">Edward A Ortiz - Machine Learning Engineer - Holberton School | LinkedIn</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df1aad6cb49a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/achieve-bayesian-optimization-for-tuning-hyper-parameters-df1aad6cb49a">Achieve Bayesian optimization for tuning hyper-parameters</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Transfer Learning as an methodology for efficiency in training CNN’s models]]></title>
            <link>https://medium.com/analytics-vidhya/understanding-transfer-learning-as-an-methodology-for-efficiency-in-training-cnns-models-1322d316173a?source=rss-97dbe9327662------2</link>
            <guid isPermaLink="false">https://medium.com/p/1322d316173a</guid>
            <category><![CDATA[transfer-learning]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Edward Ortiz]]></dc:creator>
            <pubDate>Fri, 03 Jul 2020 18:48:52 GMT</pubDate>
            <atom:updated>2021-04-08T15:20:00.948Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*QmFlFcufVrSZ7gZwsjJ_tg.png" /><figcaption>Image classification. Image credit: Gluon-cv.mxnet.io</figcaption></figure><h3>Understanding Transfer Learning as a methodology for efficiency in training CNN’s models</h3><h3>Abstract</h3><p>The training of a ConvNet model using large data sets can take hours and the performance of it may be affected by the method in which is being applied the training. For attend this scenario, a technique called Transfer Learning started to be implemented in ConvNets architectures to improve the time performance and accuracy for the implementation of pre-trained models to new models. Transfer learning is a paradigm applied to any neural network architecture but in the case of the computer vision field this technique has proven interesting results. The following paper will explore by using CFAR-10 data set the performance of transfer learning implementation, training an evaluation in a DenseNet-121 architecture. The technique implemented in the transfer learning process is a fine-tuning, freezing the entire DenseNet-121 architecture as well as the modification of that architecture using <em>batch-normalization</em>, <em>Adam</em> algorithm <em>optimization</em>, <em>dropout</em> and <em>learning rate</em>.</p><blockquote>Key words: Transfer Learning, DenseNet-121, Batch-normalization, Fine-tuning, accuracy, loss</blockquote><h3>Introduction</h3><p>Convolutional neural networks is a category within the Neural Networks field for Machine Learning or Artificial Intelligence. The ConvNets are highly effective architectures for image recognition and classification. Because the Neural Network in computer science is an analogy of the pattern of function from the Human Brain and the ConvNets architecture resembles the Visual Cortex of image recognition and classification of the human eye, in the Machine Learning field to replicate these ConvNets architectures it is used large set of data (images) to get a good response of this algorithm. The training of large data sets can take hours and the performance may be affected by the method in which is being applied the training.</p><p>These machine learning architectures usually require abundant data under a stationary environment. But, in real-world environments the pattern is that user’s interact with the preferences (weights, parameters, biases) making the architecture a dynamical model (Widmer <em>et al</em>. 1996). In response to this scenario, a technique called Transfer Learning started to be implemented and actually is frequently used in ConvNets architectures to improve the time performance and accuracy for the implementation of pre-trained models to new models (Gulli <em>et al</em>. 2017) .</p><p>Transfer learning is a paradigm in which by acquiring the knowledge of a pre-trained model the solution for one related task will be compatible over the new model. Transfer learning was initially discussed and classified into three different settings: inductive transfer learning, transductive transfer learning and unsupervised transfer learning (Pan, <em>et al.</em> 2009). However over the years the Transfer Learning technique has improved by being intuitive and enhancing</p><p>In this article we explore the behavior of the transfer learning technique in a DenseNet-121 architecture implementation with a CIFAR-10 data set. This architecture maintains a simple connectivity pattern seeking the maximum information flow between layers in the network by connecting all layers (with matching feature-map sizes) directly with each other. To preserve the feed-forward nature, each layer obtains additional inputs from all preceding layers and passes on its own feature-maps to all subsequent layers. (Huang <em>et al</em>. 2016)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CTbsjdm6f1ESaDYrpWpZmw.png" /><figcaption>Figure 1. DenseNet representation. Image credit: Huang <em>et al</em>. 2016</figcaption></figure><p>Currently there are different methods to implement transfer learning in a neural network such as data augmentation, fine-tuning, freezing, multitask, one-shot learning, domain adaptation, domain confusion and zero-shot learning. There is no accurate or ideal technique but there is a behavioral change in each implemented transfer learning technique. This article, will cover a proposed implementation using fine-tuning, and freezing techniques in a pre-trained densenet-121 architecture aiming to understand the time response and performance in the accuracy and loss of a valid data set of 10000 samples from the CIFAR-10 data set.</p><h3>Techniques</h3><h4>Transfer Learning — Fine-tuning</h4><p>Transfer learning attends the need for lifelong machine-learning methods that retain and reuse previously learned knowledge (Pan, <em>et al.</em> 2009). Figure 2 present a comparison between the traditional process of learning and one applying Transfer learning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*Vz1d1ddPa0VGwVwiznpjXw.png" /><figcaption>Figure 2. Transfer Learning representation. left(Traditional Machine Learning), right(Transfer Learning). Image credit: (Pan, <em>et al.</em> 2009)</figcaption></figure><p>Based on this idea, fine-tuning complements the transfer learning method due the machine learning model passes over a process in which all the layers of the model or some of the layers are frozen, which is necessary so the training can be initialized in the top layers with new classifiers that are randomly initialized but the frozen layers still contains the parameters and will support the extraction of the features.</p><p>The transfer learning technique implementing fine-tuning, adjusts the more abstract representations of the model being reused, so there is a re usability and efficiency in the prediction over the new trained parameters.</p><h3>Experiments</h3><p>The experiment consisted in put the ConvNet in three separated training processes. One a regular training over the entire model, a second one adding optimization and regularization techniques, and a third one applying transfer learning freezing all the layers in the model and fine tuning the last layers to be trained over the validation data of the dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*r_Vunmr4QYSc4S7l6O0r_A.jpeg" /><figcaption>Figure 3. Densenet 121 Blue (Freezed layers), Green (Fine-tuning). Image credit: Author source</figcaption></figure><h4>Dataset</h4><p>To see the behavior of Transfer learning, it was chosen the CIFAR-10 dataset which contains 60000 32x32 color images in 10 classes, with 6000 images per class. There are 50000 training images and 10000 test images. This complex dataset was set to be trained over an architecture DenseNet-121 (Huang <em>et al</em>. 2016).</p><h4>Training</h4><p>All models were previously preprocessed and their inputs reshaped in a size of (155, 155). The optimizer for the training was ADAM using 128 batch and 32 epochs. The learning rate was between 0 and 1 with a early stopping of 1e-05. Both architectures also had two batch normalized layers before the softmax layer in the classification layers and these two layers with a dimensionality of the output space of 256 and 128 respectively. Finally dropout at 0.2 in the last activated layer after the last batch normalization. The base model of the ConvNet had a total of 6,964,106 trainable parameters; the base model with optimization techniques in the classifier layers had 7,252,746 trainable parameter and the ConvNet model with the fine-tuning implementation had 4,262,026 trainable parameters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*R6v0-pGpZXbJNUS6d8pnNg.png" /><figcaption>Figure 4. DenseNet 121 Base model</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*cNjqdjK5A11lLIokyFBNRw.png" /><figcaption>Figure 5. DenseNet 121 Base model adding optimization dropout and batch normalization in classifier layers</figcaption></figure><p>For the Transfer learning training, the workflow implemented was to take the model up to the classification layers, froze them, to avoid destroying any of the information they contain during future training rounds, then add the classification layers that are unfrozen and trainable. These last layers will learn to turn the old features into predictions on a new dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*9K-Dhmz3EII7lJlh4ojrqw.png" /><figcaption>Figure 6. DenseNet 121 Fine-Tuning Implemented</figcaption></figure><h3>Results</h3><p>Both model performed similar. There was small differences and is due the size of the dataset. Whereas this data set has heavy information. The more trainable samples the data set has the more differences will be presented.</p><p><strong>Accuracy. </strong>The base model with optimization applied had an accuracy rate of 95.35% performed considerably better than the transfer learning model. This model had an accuracy rate of 92.72%, interestingly having a steady trend in the learning process as the figure 4 presents. The base model had a different behavior, where the learning process increased over the epochs the accuracy rate until the epoch 19 where achieved the highest result. Finally, the base model without optimization parameter performed at 86.59%, presumably due there was not an optimization technique applied.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a67Js7wyzO7uqhf6JZE6oQ.png" /><figcaption>Figure 7. DenseNet 121 Base Model Valid accuracy</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*yMz14zWCubkQt_A0GEAd8g.png" /><figcaption>Figure 8. DenseNet 121 Base Model Trasfer Learning Valid accuracy</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*Hv0CEl2YxiiCRcajowoP_Q.png" /><figcaption>Figure 9. DenseNet 121 Base Model (No optimization applied) Valid accuracy</figcaption></figure><p><strong>Time. </strong>The loss in each of the three model was an important feature to track. The fine tuning model took a time of 44.10 min and the base model with optimizer took 139.5 min. The standard model took a 13.8 min to be fully trained. The fine tuning technique is faster by a 68.38% with a basic model no standardized and 68.70% slower that a basic training model without optimization techniques. However when weighting the accuracy vs the time the perform is much better in the transfer learning model.</p><p><strong>Loss and Overfitting. </strong>The DenseNet model performed efficiently to be less prone to overfitting in all of the three experiments. As for the loss, the loss validation of the sample in relation the validation accuracy of the base model, sustained a rate of 65%. Compared with the model with a fine tuning implementation, the loss was 48.2% better having a loss in the validation samples of 33.67%. Nevertheless, the DenseNet model without transfer learning but optimized with batch normalization had a loss of 16.29% being the best model trained</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u8nwI6hJtE2ScSNo1OpFYA.png" /><figcaption>Figure 10. DenseNet 121 Base Model (Optimization applied) Valid loss</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*1c2GMcoxzEfBO-D6AVijWw.png" /><figcaption>Figure 11. DenseNet 121 Base Model (Transfer learning applied) Valid loss</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*Elso676kaqKLdKIyKZ2qfw.png" /><figcaption>Figure 12. DenseNet 121 Base Model (No optimization applied) Valid loss</figcaption></figure><h3>Discussion</h3><p>As we mentioned at the beginning of this paper, we wanted to understand the performance of the traditional learning of the DenseNet 121 ConvNet architecture in a environment of traditional learning, vs optimized learning vs, transfer learning. The ConvNets architectures in a computer vision field of work requires excellent performance to solve applicable simulations that requires the evaluation of information captured in images. This leads to a problem in performance and time that Transfer Learning can enhance without sacrificing the accuracy or loss of the model. As we’ve seen, training a base ConvNet model needs a series of steps to avoid issues in the overfitting, underfitting or performance accuracy. The batch normalization proved to be a great option to improve a ConvNet presenting a model trained accuracy in validation data of 95%. When Transfer Learning is applied, there is a minor reduction of the performance but the time execution indeed create a value for take a transfer learning approach.</p><h3>Conclusion</h3><p>We understood that Transfer learning by adding fine-tuning to it is a great option to implement in ConvNets that are used to an approach where are different labels in the target task. Due the experiment was using CIFAR-10 it was concluded too that the transfer learning model required mode data to improve their performance. Also it was evident between the base model and the enhanced model that DenseNet tends to improve their performance in accuracy with a larger number of trainable parameters but in order to risk a overfitting of the data the batch normalization is an excellent tool to implemented in this model. ConvNets currently are widely used in simulations and the excess of data that needs to be trained requires not only a good accuracy but time performance. Therefore, by facing a simulation problem where the objects source is different with the probability of the simulation to be performed creates a challenge in complexity training that a dine-tuning approach are able to handle by freezing if not all layers some of the layer of a ConvNet model to be later unfrozen and take this trainable parameters into the new model training thus syncing both similar parameters and obtain an accurate simulation.</p><h3>References</h3><p>François Chollet. Deep Learning with Python. 2017</p><p>Gerhard Widmer and Miroslav Kubat. Learning in the presence of concept drift and hidden contexts. Machine Learning, 69–101, 1996</p><p>Antonio Gulli and Sujit Pal. Deep Learning with Keras. Implement neural networks with Keras on Theano and TensorFlow, 204, 2017</p><p>Gao Huang, Zhuang Liu, Laurens van der Maaten, Kilian Q. Weinberger. <a href="https://arxiv.org/pdf/1608.06993.pdf">Densely Connected Convolutional Networks</a>, 2016</p><p>Sinno Jialin Pan and Qiang Yang. <a href="https://www.cse.ust.hk/~qyang/Docs/2009/tkde_transfer_learning.pdf">A Survey on Transfer Learning</a>, 2009</p><p>Evergreen Technologies. <a href="https://medium.com/@evergreenllc2020/dog-breed-image-classification-using-transfer-learning-6d19699d4351">Dog breed image classification using transfer learning</a>, 2020</p><p>Sebastian Ruder. Transfer Learning — <a href="https://ruder.io/transfer-learning/">Machine Learning’s Next Frontier,</a> 2017</p><p>Dipajan Sarkar. <a href="https://towardsdatascience.com/a-comprehensive-hands-on-guide-to-transfer-learning-with-real-world-applications-in-deep-learning-212bf3b2f27a">A Comprehensive Hands-on Guide to Transfer Learning with Real-World Applications in Deep Learning</a>, 2018</p><h3>Appendices</h3><h4>Basic DenseNet model (No enhanced, no transfer learning)</h4><p><a href="https://github.com/edward0rtiz/holbertonschool-machine_learning/blob/master/supervised_learning/0x09-transfer_learning/0-transfer_basic.ipynb">edward0rtiz/holbertonschool-machine_learning</a></p><h4>Best DenseNet model (Base Model added optimization in classification layers)</h4><p><a href="https://github.com/edward0rtiz/holbertonschool-machine_learning/blob/master/supervised_learning/0x09-transfer_learning/0-transfer.py">edward0rtiz/holbertonschool-machine_learning</a></p><h4>Transfer Learning DenseNet model (Base Model added optimization and fine-tuning in classification layers)</h4><p><a href="https://github.com/edward0rtiz/holbertonschool-machine_learning/blob/master/supervised_learning/0x09-transfer_learning/0-transfer_fine_tuning.py">edward0rtiz/holbertonschool-machine_learning</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1322d316173a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/understanding-transfer-learning-as-an-methodology-for-efficiency-in-training-cnns-models-1322d316173a">Understanding Transfer Learning as an methodology for efficiency in training CNN’s models</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding the ImageNet classification with Deep Convolutional Neural Networks]]></title>
            <link>https://medium.com/analytics-vidhya/understanding-the-imagenet-classification-with-deep-convolutional-neural-networks-e76c7b3a182f?source=rss-97dbe9327662------2</link>
            <guid isPermaLink="false">https://medium.com/p/e76c7b3a182f</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[dummies-guide]]></category>
            <dc:creator><![CDATA[Edward Ortiz]]></dc:creator>
            <pubDate>Sat, 13 Jun 2020 06:38:34 GMT</pubDate>
            <atom:updated>2020-06-26T15:44:36.662Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*76BqRPqPb-OrCRSFAx6iaw.png" /><figcaption>Image credit: Neurohive.io</figcaption></figure><p>A brief review about the famous AlexNet Architecture paper.</p><p>In 2012 many important things happened in the world. In fact, before I started to write this blog I searched for those important events that year and if you want to see you can check in this <a href="https://gizmodo.com/the-most-important-events-of-2012-in-14-gifs-5968394">link</a>.</p><p>However, that year there was held a competition that wasn’t well known by us. The ImageNet LSVRC-2012 competition is an annual computer vision competition developed upon a subset of a publicly available computer vision data set called ImageNet.</p><p>The challenge is based on a very large collection of human annotated photographs designed by academics and the goal of the challenge was to promote the development of better computer vision techniques and to benchmark the state of the art.</p><p>The LSVRC challenge focuses on multiple tasks for “<em>image classification</em>” that includes both assigning a class label to an image based on the main object in the photograph and “<em>object detection</em>” that involves localizing objects within the photograph.</p><p>That 2012, Alex Krizhevsky, Ilya Sutskever and Geoffrey E. Hinton published and subsequently won the ILSVRC-2012 competition by creating an unique Deep Convolutional Neural Network that was able to classify <strong>1.3 million high-resolution images</strong> into <strong>1000 different classes</strong> and having a <strong>15.3% </strong>test<strong> </strong>error rate which was by far better than the second place model (26.2%)</p><p>This achievement meant for the entire world much more that what we think. Thanks to the creators of AlexNet the study in deep learning not just explode, the tech companies started to invest more in technologies of classification using AlexNet at that moment and creating other models to create realistic solutions to problems such as detection images, classification of images and more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/1*7oc4ZaCHlwjuW6IWnZ9WzA.jpeg" /><figcaption>Image credit: Wired</figcaption></figure><p>Think about this, In Seattle, Amazon developed a supermarket where you can buy without the need to go to a cashier. The customer pick the products and the goods are charged to the credit card once the customer leaves the store and there is no person who verifies the content of your products, just cameras!. This is all due the image detection and classification from the cameras to the products that the customer select. This innovation from Amazon in part is thanks to AlexNet and the following developments in the area.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*sFZh5qGSll8sbjR8S3IkbA.jpeg" /><figcaption>Amazon Go. Image credit: CNN</figcaption></figure><p>Now that I got your attention I am going to be a little bit conceptual and explain to you how the AlexNet architecture works and by the end of this blog I hope you get the idea of how this DNN (Deep Neural Network) was a big deal at that moment and as for today still is a a reference for AI development and innovations such as Amazon Go.</p><h3>The AlexNet Model</h3><p>AlexNet trained a large, deep convolutional neural network to classify the <strong>1.3 million high-resolution images in the LSVRC-2010 ImageNet training set into the 1000 different classes</strong>. This means, for example that you have a collection of 1.3 million images of animals and this model was able to classify them into 1000 different species.</p><p>On the test data, they achieved top-1 and top-5 error rates of 39.7% and 18.9% which is considerably better than the previous state-of-the-art results. We humans, are the most intelligent species on earth, but we use the technology and computers to improve our calculations. Today we are training the computers to perform tasks like this (computer vision) . This is a revolution itself and AlexNet was able to present a model who does a classification of images with a rate so small that in that moment 2012 was unthinkable that a machine can perform.</p><p>Today the number of error is much lower, in fact some challenges the machine have outnumbered the performance in computer vision over a human. However, according to Fei-Fei Ling when she said in 2015 “Even the smartest machines are still blind,”, Indeed, AI and deep learning have helped improve accuracy rates in these tasks of computer vision , but when it comes to classify deeper an image based on the background context or the backstory, there is still plenty to be done from a machine.</p><blockquote>The neural network, which has <strong>60 million parameters and 500,000 neurons</strong>, consists of <strong>five convolutional layers</strong>, some of which are followed by max-pooling layers, <strong>and two globally connected layers</strong> with a final <strong>1000-way softmax</strong>.</blockquote><h4>AlexNet technical information</h4><p>The architecture use Relu instead of Tanh to add non-linearity. It accelerates the speed by 6 times at the same accuracy. It also, use dropout instead of regularization to deal with overfitting. The training time is doubled with the dropout rate of 0.5. Finally, the overlap pooling to reduce the size of network. It reduces the top-1 and top-5 error rates by 0.4% and 0.3%, respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*29VH_NiSdoLJ1jUMLrURCA.png" /><figcaption>Activation functions. Image credit: Sagar Sharma</figcaption></figure><h4>AlexNet technical architecture</h4><p>AlexNet, contains five convolutional layers and three fully connected layers. Relu is applied after very convolutional and fully connected layer. Dropout is applied before the first and the second fully connected year. The image size in in AlexNet architecture is 227 * 227. The input size is 224 * 224 with 2 padding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*V51iWGKotRNt6fZM-mJ_KA.png" /><figcaption>Image credit: <a href="https://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks.pdf">ImageNet Classification with Deep Convolutional Neural Networks</a></figcaption></figure><p>f you don’t understand this part don’t worry, look at the next two images and compare it with the image below and try to think that this architecture is like the process your eye does when you are recognizing any image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/883/1*imPuPfJ0-9jhmTVjzwPGzQ.png" /><figcaption>Deep Convolutional Neural Network. Image credit: Mannig</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*eYktbpZcTTRuls8hcmmamA.gif" /><figcaption>How our eyes works. Image credit: Kid’s health</figcaption></figure><h3>The training</h3><p>The AlexNet model takes 90 epochs in five or six days to train on two GTX 580 GPUs. SGD with learning rate 0.01, momentum 0.9 and weight decay 0.0005 is used. Learning rate is divided by 10 once the the accuracy plateaus. The leaning rate is decreased 3 times during the training process.</p><h3>Conclusion</h3><p>Many of the cool real sci-fi stuff that we have today such as the Instagram filters, the access to buildings without a fingerprint verification and just by looking a camera, the autonomous driving and much more are thanks to the ILSVRC challenge and people like Alex Krizhevsky, Ilya Sutskever and Geoffrey E. Hinton. Because of them we have achieved many news milestones in this area of the AI development</p><p>This revolution in the AI and Deep Learning, has also created revolution in performance of machines. Today we have a better computers to train these models. the GPU development from the manufactures are not only for the gaming industry. Now you know what other uses these awesome machine can do besides playing Red Dead Redemption 2</p><p>As for the AlexNet architecture, It was a key role the optimization algorithms, the regularization methods and the activation functions. That means that if you want to train a good model in order to solve a problem yo have to try ans test with different options and to see the behavior of your model to get a good accuracy and avoid overfitting in your model</p><p>Thanks to the tons of data that we have today around us, I encourage you to know more about AI, Machine Learning and Deep Learning. Since I started to apply in my professional career Deep Learning and Machine Learning, I’ve seen better results in solving problems by being more accurate in the information that I present either for my clients or for my bosses. The more precise you are with the information the more you can create a successful strategy to solve a problem.</p><h3><strong>References</strong></h3><ul><li><a href="https://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks">ImageNet Classification with Deep Convolutional Neural Networks</a></li><li><a href="https://freecontent.manning.com/pytorch-crash-course-part-2/">PyTorch Crash Course, Part 2 | Manning</a></li><li><a href="https://machinelearningmastery.com/introduction-to-the-imagenet-large-scale-visual-recognition-challenge-ilsvrc/">A Gentle Introduction to the ImageNet Challenge (ILSVRC) - Machine Learning Mastery</a></li><li><a href="https://www.learnopencv.com/understanding-alexnet/#:~:text=AlexNet%20Architecture,two%20GTX%20580%203GB%20GPUs.&amp;text=AlexNet%20consists%20of%205%20Convolutional%20Layers%20and%203%20Fully%20Connected%20Layers.">Understanding AlexNet</a></li><li><a href="https://neurohive.io/en/popular-networks/r-cnn/">R-CNN - Neural Network for Object Detection and Semantic Segmentation</a></li><li><a href="https://www.entrepreneur.com/article/283990">Can Artificial Intelligence Identify Pictures Better than Humans?</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e76c7b3a182f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/understanding-the-imagenet-classification-with-deep-convolutional-neural-networks-e76c7b3a182f">Understanding the ImageNet classification with Deep Convolutional Neural Networks</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine Learning 101 part 2]]></title>
            <link>https://edward0rtiz.medium.com/machine-learning-101-part-2-366bb5607ef8?source=rss-97dbe9327662------2</link>
            <guid isPermaLink="false">https://medium.com/p/366bb5607ef8</guid>
            <category><![CDATA[dummies-guide]]></category>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[optimization-algorithms]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Edward Ortiz]]></dc:creator>
            <pubDate>Tue, 26 May 2020 03:01:24 GMT</pubDate>
            <atom:updated>2020-05-26T19:15:19.079Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n25JdVsksa69-aUGhIaSog.jpeg" /><figcaption>Image credit: Scott Adams</figcaption></figure><p><em>Explaining the mechanics behind optimization techniques</em></p><p>While ago I published an article about the <a href="https://medium.com/@edward0rtiz/machine-learning-101-2ceb4f630ffa">basic concepts on machine learning</a> from a perspective of a person who was getting introduced in this area. I explained the basic concepts from a pragmatical perspective so anyone can understand it and to start a conversation about machine learning without feeling out of context and to find out how this study is impacting our lives in ways that we cannot imagine.</p><p>Now, in this post we are going to introduce other new concepts that are part of the machine learning process but specifically in the implementation of deep neutral networks in order to solve any problem so we can find natural patterns with the data available right now and to generate insight that help us as society to make better decisions and predictions. The concepts that we are going to cover in this post are the following:</p><ol><li>Feature Scaling</li><li>Batch Normalization</li><li>Mini-batch gradient descent</li><li>Gradient descent with momentum</li><li>RMSProp optimization</li><li>Adam Optimization</li><li>Learning rate decay</li></ol><p>If you are not related with mathematics, statistics or machine learning yet, don’t be overwhelmed. My objective with this article is that you get the basics of the topics that we are going to explain, and your curiosity increases after this. I will try to explain it as much simpler as I can because I know the challenge it is when you want to learn something and that information is quite hard to understand.</p><p>So let’s get started!</p><h3>The seed concept</h3><p>Before to start we are going to define machine learning and from several definitions you may find in books, papers, internet, I just going to stick with this definition of Machine Learning:</p><blockquote>“Machine learning is the science to implement algorithms and to get the computers to act by using the current data without being explicitly programmed”</blockquote><p>In other words, take from the data available in this moment the portion you need in order to solve a problem, give it to a computer, set the instructions and let the machine do the work of process the data and deliver to you the results so you can create and strategy and solve the problem.</p><h3>Going deeper</h3><p>Seems easy, but we have need to go deeper to fully start understand that science by including a new definition and its deep learning. Again, from many definition I think this definition of deep learning will fit to achieve the objective of this post:</p><blockquote>Deep Learning is a superpower. With it you can make a computer see, synthesize novel art, translate languages, render a medical diagnosis, or build pieces of a car that can drive itself. If that isn’t a superpower, I don’t know what is. -Andrew Ng-</blockquote><h3>The models</h3><p>You have the basic concept of Machine Learning, now in order you can have access to the right information when letting a computer do the hard work of process the information by itself, there are models that will fit your necessity.</p><p>You can choose between:</p><ol><li>Supervised model: The user implement functions (algorithms) so the machine when receives data (inputs) it can process it iterative (train-data) and turn in into information (output).</li><li>Unsupervised model: The user also implements functions but this time the machine is more independent to process the data and the result of it is information translated in patterns no referenced.</li></ol><p>By understanding what using a proper model in machine learning it can affect the desired outcome of the problem that you ant to solve.</p><h3>Optimization</h3><p>Now, heading back into the topic if this post, you already have a brief definition of the machine learning, the deep learning and the models used by this science. However, the concepts we highlighted at the beginning of this post are part of something called “optimization”. This term in machine learning refers to algorithms that serves to optimize procedures in the model that minimizes the error of that model on the training data set. The optimization in machine learning is performed by a sort of algorithms called optimization algorithms that are classified into single- variable optimization algorithms, multi — variable optimization algorithms, constrained optimization algorithms, specialized optimization algorithms and non-traditional optimization algorithms.</p><p>We are not going to cover each class of these algorithms, in fact we are going to explain the most used optimization algorithms so you can have a brief understanding of this important topic.</p><h4>Feature Scaling</h4><p>Feature scaling is a set of important functions that the user needs to implement during the pre-processing of data, this means that before getting into the model it is necessary to scaling the data. Feature scaling is to standardize you data set into independent features. For example you work for a real state company and you want to predict based on the salary, the age and the price of the property if a person can buy or not a property, so you have a data set of 500000 people, each having these independent data features. You want to label the data in to parts (people can afford to buy a property and people who cannot afford to buy a property)</p><p>So what you do is to normalize and standardize the set of data so you can place the st of variables independently and to process not only faster the model but accurately to make your prediction. The normalization has to be typically between 0 or 1 ( consider that is ‘yes’ or ‘not’)</p><p>When you applied feature scaling your data set is transformed into this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fn8YqduXpl0k_TtLhBxGiw.png" /><figcaption>Feature-scaling -All about Feature Scaling- <a href="https://towardsdatascience.com/@baijayanta.roy?source=post_page-----bcc0ad75cb35----------------------">Baijayanta Roy</a></figcaption></figure><p>And based in our example the scaled data set will look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/1*QbgmM9ty8MitufOWje5Tqg.jpeg" /><figcaption>Feature-scaling</figcaption></figure><p>As you saw the scaling process is a must and an advantage for create a machine learning model. If there is no a normalization and a standardization of the data prior the training process the speed of processing will be slower and it will not be accurate.</p><h4>Batch Normalization</h4><p>You already saw what normalization is, so what do you think batch normalization is?. You are correct!, by looking at the name it is implied with the word batch that is a portion of the data, then batch normalization is to have the data set, split it into batches and normalize these batches. The reason behind this process is basically to make your computer process a little bit faster, increase the learning rate of your machine and to be more reliable if you have a larger data set. Te same definition but i from a technical approach is that, batch normalization adds two trainable parameters to each layer, so the normalized output is multiplied by a “standard deviation” parameter (gamma) and add a “mean” parameter (beta)</p><p>Batch normalization can be seen better from an implementation of a deep neural network when you have n-layers to process to get to your output like this image presents:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*Y0EtAQpR2iBsv97YrwRywg.png" /><figcaption>batch normalization. deeplearning.ai</figcaption></figure><p>By looking at this picture just look at the arrows and think that these are the processes that the machine has to do with the data you placed initially in each circle. Therefore makes all sense to split the data into batches so the process can be more efficient.</p><h4>Mini-batch gradient descent</h4><p>We covered what a batch normalization is. Now in order to explain mini-batch gradient descent, we have to explain what a gradient descent is. Basically Gradient descent is an optimization algorithm often used for finding the weights or coefficients of machine learning algorithms, such as artificial neural networks and logistic regression. <a href="https://machinelearningmastery.com/gradient-descent-for-machine-learning/">Jason Brownlee</a> exposes an interesting example in where you have to think that you have a large bowl and this bowl is the plot of your cost function; then, a random position on the surface of the bowl is the cost of the current values of the coefficients (cost), the bottom of the bowl is the cost of the <strong>best</strong> set of coefficients, the minimum of the function.</p><blockquote><em>Gradient descent is the backbone of neural networks training and the entire field of deep learning. This method enables us to teach neural networks to perform arbitrary tasks without explicitly program them for it.</em></blockquote><p>The goal with gradient descent is to continue to try different values for the coefficients, evaluate their cost and select new coefficients that have a slightly better (lower) cost. Repeating this process enough times will lead to the bottom of the bowl and you will know the values of the coefficients that result in the minimum cost. The following graphic will give you an overview of this theoretical explanation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/295/1*4wYeb3VpTIBb6wW8wYvOmQ.png" /><figcaption>Gradient descent image source: <a href="https://ml-cheatsheet.readthedocs.io/">https://ml-cheatsheet.readthedocs.io/</a></figcaption></figure><p>Now that you already know what a gradient descent is, the mini-batch gradient descent is a variation of the gradient descent algorithm and the main difference is that the data set is split into small batches that are updated independently in a cycle. This process is called <em>epoch </em>and the main advantage of this optimization algorithm is that computationally this process is more efficient, it is more stable and the calculation of the prediction errors along the model update can be performed in parallel.</p><p>However, the disadvantages of this algorithm is that the implementation of the cycle process in the training epoch is a little bit more complex over the regular gradient descent and not to have a proper implementation can lead to errors in all the mini batches. Also, if you have a large data set the split of the data into mini batches eventually may reduce the training speed over other optimization algorithms.</p><p>This image will give you a better comprehension in the behavior of this algorithm:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*bKSddSmLDaYszWllvQ3Z6A.png" /><figcaption>Image source: <a href="https://datascience.stackexchange.com/">https://datascience.stackexchange.com/</a></figcaption></figure><h4>Gradient descent with momentum</h4><p>We have been reviewed optimization, gradient descent, batch, mini-batch gradient descent. Now in this algorithm there is a new word that is “Momentum”. Momentum in machine learning is another optimization technique that consist instead of using just the gradient of the current step to guide the search, the momentum also accumulates the past steps to define the next direction. Let’s say that momentum is a trick to reduce to speed up the convergence of the gradient descent optimization and reduce the zig-zag behavior of the gradient descent like this image shows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*y4bIkUhCKFKi7ajsQv5HAA.png" /><figcaption>image source: Reza Borhani. Machine Learning Refined</figcaption></figure><p><strong>RMSProp optimization</strong></p><p>This algorithm has gained popularity due its efficiency and speed. RMSprop is a short version of Root Mean Square Propagation. As a curious fact, this optimization algorithm was proposed for first time by Geoffrey Hinton in a Coursera class. The RMSProp is similar to the gradient descent algorithm with momentum with the difference that RMSprop creates a restrictions in the oscillations in the vertical direction. So that creates an advantage and it is that the model increase the learning rate and the algorithm by taking larger steps heading in a horizontal way the converge is faster.</p><p>The following picture presents the behavior of the RMSProp and as you can see, the difference between the other gradient descent optimizer is that the direction looks more unstable but it reaches the local optima faster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*__1OV2sa8YNER7vIR4EZJg.png" /><figcaption>RMSProp</figcaption></figure><h4>ADAM Optimization</h4><p>ADAM stands for “Adaptive Moment”. This optimization algorithm is the combination of the momentum and RMSProp. This algorithm computes adaptively the learning rates in other words, it computes individual learning rates for different parameters. ADAM uses estimations of first and second moments of gradient to adapt the learning rate for each weight (parameter) of the neural network. Notice that we are introducing the term moment and the moment cannot be mistaken with momentum. Moment is a random variable (N-th) defined as the expected value of that variable to the power of n.</p><p>ADAM is a little bit confusing at the first time because it takes in consideration moments in a training process, so the importance in this post is that you get the first definition and by curiosity start to get deeper in the behavior if this optimizer. The next image show how ADAM performs over other optimizer. (The lower the <strong>loss,</strong> the better a model unless the model has over-fitted to the training data)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*7EJAxaDf9UrXyF4XbcUQdA.png" /><figcaption>Image source <a href="https://www.researchgate.net/profile/Amirhessam_Tahmassebi">Amirhessam Tahmassebi</a></figcaption></figure><p>If you want to know more bout this optimization algorithm I recommend that check out the paper <a href="https://arxiv.org/pdf/1908.03265.pdf"><em>On the Variance of the Adaptive Learning Rate and Beyond</em></a></p><h4>Learning rate decay</h4><p>First of all we have to understand what learning rate is. Learning rate is the single most important hyper-parameter (parameter whose value is set before the learning process begins) in training neural networks. Then, the learning rate would help by increasing or affect by slowing the speed of the learning algorithm; then, the learning rate decay is a technique where it is initialized a large learning rate and then decay it by a certain factor after pre-defined epochs. The next image can explain better this concept:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/305/1*1OA5qhH337VOdPSwktYbpw.png" /><figcaption>Image source: Kaichao You, Mingsheng Long, Jianmin Wang, Michael I. Jordan. <a href="https://arxiv.org/abs/1908.01878">https://arxiv.org/abs/1908.01878</a></figcaption></figure><h3>Conclusions</h3><p>Optimization algorithms is a must to learn in machine learning. Understanding these techniques will make you different by the moment you are creating a machine learning model. If you recognize the pros and the cons of these algorithms, you will have better performance in the validation of data in your training model and therefore a better understanding of the problem you want to solve applying machine learning.</p><p>You may noticed that by the end of this post the definition of the concepts were shorter than before. I did that intentionally because if your curiosity got you into this article and as I said before you don’t know much about machine learning and these concepts, I find more valuable that your curiosity doesn’t extinguish but on the contrary you start to search and digging more into this amazing science that is taking the lead for the technological innovation and he evolution as society supported with the current and future tech hardware.</p><p>Most people recommend in this industry recommend tho start looking at mathematics with linear algebra and calculus and I am not going to say anything different than that. However, I myself at the beginning of this journey I was found overwhelmed about the complexity of the information that machine learning as science contains, but the current information online mostly academic papers will lead you for a better understanding of these concepts. Also you will find support in communities but because the nature of the community is to supoport you in any doubt or challenge you face, first consider to solve your doubts by pushing yourself into finding the resources to solve this problem before start asking. This, I believe will lead you in a better path to understand and apply functionally Machine Learning.</p><h3>References</h3><ul><li><a href="https://arxiv.org/abs/1908.01878">How Does Learning Rate Decay Help Modern Neural Networks?</a></li><li><a href="https://arxiv.org/abs/1908.03265">On the Variance of the Adaptive Learning Rate and Beyond</a></li><li><a href="https://machinelearningmastery.com/gradient-descent-for-machine-learning/">Gradient Descent For Machine Learning - Machine Learning Mastery</a></li><li><a href="https://books.google.com.co/books?hl=en&amp;lr=&amp;id=JPQx7s2L1A8C&amp;oi=fnd&amp;pg=PR5&amp;dq=optimization+machine+learning&amp;ots=vdl6yjo5B8&amp;sig=MonPFygOpuNHGwiLJ2yB6lMGUHI#v=onepage&amp;q=optimization%20machine%20learning&amp;f=false">Optimization for Machine Learning</a></li><li><a href="https://medium.com/@edward0rtiz/machine-learning-101-2ceb4f630ffa">Machine Learning 101</a></li><li><a href="https://emerj.com/ai-glossary-terms/what-is-machine-learning/">What is Machine Learning? - An Informed Definition</a></li><li><a href="https://towardsdatascience.com/all-machine-learning-models-explained-in-6-minutes-9fe30ff6776a">All Machine Learning Models Explained in 6 Minutes</a></li><li><a href="https://www.deeplearning.ai/">Home</a></li><li><a href="https://www.geeksforgeeks.org/ml-feature-scaling-part-1/?ref=rp">ML | Feature Scaling - Part 1 - GeeksforGeeks</a></li><li><a href="https://towardsdatascience.com/all-about-feature-scaling-bcc0ad75cb35">All about Feature Scaling</a></li><li><a href="https://ml-cheatsheet.readthedocs.io/en/latest/gradient_descent.html">Gradient Descent - ML Glossary documentation</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=366bb5607ef8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Development of the full stack web application “Commodoro”]]></title>
            <link>https://edward0rtiz.medium.com/development-of-the-full-stack-web-application-commodoro-ec22668ec6b5?source=rss-97dbe9327662------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec22668ec6b5</guid>
            <dc:creator><![CDATA[Edward Ortiz]]></dc:creator>
            <pubDate>Thu, 26 Mar 2020 21:47:02 GMT</pubDate>
            <atom:updated>2020-03-26T21:47:02.856Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V9G7baSwC-VuBrcaTYDAgA.png" /></figure><p><em>Study case of the development of Commodoro the largest network of coffee farmers</em></p><p>The following blog will share the experience of the development of a full stack web application since the conception of the idea, the purpose of the web app, to the stack chosen, partial algorithm, process development and the next milestones to be achieved.</p><p>Also, this blog is for those who are interested in the development of technological sustainable products as well as to see from a larger perspective how an app is the sum of other non-technical factors such as the election and efficient team work, the design and development of an organized project, the leadership of each member of the team and other important agile skills in order the continuity and success of an app can be traceable and can be functional applied in the market.</p><h3>The Conception</h3><p>It is said that everything begins with an idea. In fact, in this case it was an idea shared not by a single individual but from three ambitious programmers that saw a way to help a larger community of people who sometimes is relegated by society and it is not rewarded properly for the huge contribution to society. This community are the farmers. They are in large part responsible for harvest the food we eat daily. We, Edward Ortiz, Carlos Molano and David Peralta, shared this concern and despite the three of us are full stack developers, we also saw in each other a different background in electrical engineering, project management, food management and skills that when merged into a single idea, the result was the development of a product thinking for this community and therefore something that will gain traction to farmers and boost the impact of agriculture with applied technology to support one of many today’s world challenge.</p><h3>The Idea</h3><p>As mentioned before, we were concerned about the hard work the farmers have today and mostly that they struggle to sell their product and make a sustainable profit. People hear often that production cost in agriculture exceed the revenue of the farmer thus causing a deficit; either for climate change or for a decreasing in the demand of that product, the current economic market doesn’t have enough benefits to cover cost overrun of the production of a harvest. This is a big problem and farmers due this conditions they have to sell their product either for private companies or government institutions so the price traded of the goods and based in a centralized market exchange.</p><blockquote><em>the current economic market doesn’t have enough benefits to cover cost overrun of the production of a harvest.</em></blockquote><p>However, when addressing this issue for the current agricultural system, we knew that in order to seek a solution we needed to close more the scope of the problem and take as a pivot, one agricultural product or as some people technically call these products (agricultural commodities), so we can develop a technological product that can be successful validated and replicated. We, knew that in the coffee market there has been a new market of trade in which private clients start a trade a process directly with the coffee farmer and trade the coffee for a fair price based in factors such as quality, organic harvesting, washing process, terrain specifications, social impact and more. Also by living in Colombia one of the largest producers of coffee in the world*, we took the time to understand the complete process for a farmer to sell their coffee either if is for national selling or exporting and to recognize that with over 560.000 coffee farms in Colombia, the country had a portion of USD$2.12B in the market over a total global of USD $34B annually in this industry. These facts among others, confirm us to create a solution starting with this commodity and to somehow create a practical solution not only for the 540.000 farmers in Colombia but for the other millions around the world.</p><p>Then, by pivoting the problem with solutions we agreed that a bottleneck for the farmers is that they always are in risk due the production cost vs the price they receive based on the market. Also, despite a new model of trade is increasing in Colombia (the one which farmer and seller is negotiating directly) not all the farmers are aware of that trade model, or cannot reach the seller for reasons such as their difficulty to leave the farm and attend international fairs, tradition in selling their product and the education given for marketing their coffee.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tEIrOOoEprN1L7crbDSLyA.jpeg" /><figcaption>First whiteboarding of Commodoro</figcaption></figure><p>Therefore, we knew that by creating a product in which a farmer can be visible to clients without leaving the farm as well as to marketing their coffee, it will increase the opportunity to increase their sales or at least the presence of their farm in the market. Then, to achieve this we thought in the creation of a web application that is a professional community online for coffee farmers, where this community basically shares profiles of the farms with the characteristics of the product, history of the farm, and other relevant data that could engage the interest of a client to contact the farmer and to trade with fair price.</p><p>Finally, we conceived the product, so the next step was to name it and we thought about Commodoro “Commodore in English”, because this word had in the past a strong relationship with merchant ships and trading of several goods. We believed that by creating a solid community for farmers in general to be engaged with private clients they will gain traction to their products and transform their farms into more productive ones with a fair trade based in decentralized market model.</p><blockquote><em>we knew that by creating a product in which a farmer can be visible to clients without leaving the farm as well as to marketing their coffee, it will increase the opportunity to increase their sales or at least the presence of their farm in the market.</em></blockquote><h3>The Design</h3><p>The idea was defined, now the team had to assemble roles and develop our product as a technological sustainable solution. Initially, the team decided to separate each role based on the large scale of production that the application will have. This means that Commodoro will have a backend, frontend and infrastructure activity.</p><ul><li><strong>Frontend: </strong>This activity is focused to the user experience and interface that Commodoro will implement. For this stage, the goal was to create a friendly user experience due most of the users will be farmers, then to be able to engage the farmers with an excellent usability as well as the supplier with the design of the site, was an objective to achieve in this area. David Peralta in this case assumed the role of solve this challenges and work as a leader in this stage.</li><li><strong>Backend:</strong> The scope of Commodoro is to evolve continuously as the users are interacting with the web app. Therefore, the design and programming of a robust backend system that will support and handle X times concurrent users and securing their data was the main goal for the development of this platform. Also, due the first deliverable is to create a custom profile page of the farms the team wanted to craft a method to handle automatic updates of the information provided by the user. Carlos Molano took the leap and assumed the role of backend leader.</li><li><strong>Infrastructure:</strong> Tied with the backend and frontend activities, the infrastructure is a key aspect for the platform. Many ideas came into mind by the time to deploy Commodoro as a functional product. LAMP stack is the most used and most reliable infrastructure for deploy an initial product, but considering the skills and experience of the team, we thought to implement another infrastructure based in the factor of concurrency of users and usage of each feature of commodore in a microservice infrastructure rather than a monolithic architecture.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5sMgyutZD89mu5ryObEmNw.png" /><figcaption>Commodoro’s Trello project board</figcaption></figure><p>By that moment we knew that there were many activities to do at the same time for develop the web application used trello, so we decided to use trello and fragment the activities in phases. The good thing about the tool trello is that a project allows to design practically the phases, roles and tasks of a project. Then the following image is a sample on how we gathered the tasks in the backend, frontend and infrastructure to have a better grasp and monitoring of the project development.</p><h3>The Timeline</h3><p>Commodoro team had a deadline of five weeks to deliver a MVP. However, we agreed to work over a six-week timeline in which the week 5 will be the presentation of the MVP and the week 6 the continuous improvement and discussion about the mutation of the project for another stage.</p><p>The following image present Commodoro timeline in this first stage:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j692k0dAN_5_WNWWxA5zbQ.png" /><figcaption>Commodoro’s Timeline</figcaption></figure><h3>The Stack</h3><p>The stack chosen for Commodoro was an interesting discussion mostly because we as team wanted to challenge ourselves, and based in our skills and goals defined for Commodoro, the technological stack should be as reliable and secure as possible. For outline the stack we thought of two main actions that Commodoro will have:</p><ul><li>Concurrency in users and actions performed</li><li>Microservice architecture</li></ul><p>Based on these two factors, the implementation of Commodoro in a monolithic stack for example NodeJS in the backend and ReactJS in the fronted was out of discussion. So we knew that Python is a high-level, general-purpose programming language for develop the backend in order to ensure models management and future decentralized transactions in real-time.</p><p>To support that decision and thinking about scalability of concurrent users we decided to use a relational database system that could support efficiently 1 Million users. The tool chosen was PostgreSQL. However, in order to ensure the performance of the implementation of the models created to be merged in PostgreSQL with the console in Python we chose a powerful framework called Django REST. This Framework based in Python for building APIS’s was used to ensure secureness by managing authentication and management of users registered in the platform. Also a particular feature that we can use from Django REST was to serialize the information in JSON lists to handle requests with other languages and to not affect the database. This is a big milestone because it allows us to deploy in the mid-term the web app into a mobile app with stable programming languages such as Kotlin and Swift.</p><p>Finally, for the web infrastructure we analyzed that a LAMP stack despite to be reliable in the long term it won’t be enough to cover concurrent users and it will be in risk overload of the servers. Then we decided to take the leap and deploy our code base in containers as microservices. The containers will be managed and monitored by Kubernetes. Some suggested us to use Docker swarm but we researched and found out that Kubernetes not also will gave us more stability in the traffic and codebase but also a better performance with the integrated load balancer focused in the traffic based in nodes. By choosing this web infrastructure we also were aware that the deploy will be affected and mostly the MVP will be finished in production but the deployment could take longer than a regular LAMP stack. Nevertheless, this risk was evaluated and assumed in order to guarantee the performance of Commodoro platform for their users.</p><p>The next image will present our stack infrastructure based in microservices</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qBYEsHdSNK4hi32JRdbC5w.png" /><figcaption>Commodoro’s Architecture</figcaption></figure><h3>The Development</h3><p>In this point is where the blog takes a more nerd approach. Since the team has defined the idea and the scope of it, and considering the timeline to deliver a first MVP, we discussed and adjust the features and deliverables of Commodoro app. Therefore, the team focused in the implementation of a customized, professional, attractive tool, to create custom profiles based on the farm information typed in a form by the farmers. The experience has to be as simple as possible so we set up a 3 step interaction (farmer registry, filling information, profile created).</p><h4><em>Backend stage</em></h4><p>The first step was to develop API native with Django and Django Rest Framework (DRF). We selected a set of variables that will be needed to create a complete farm profile. We divided them in this way:</p><p>Farm Profile:</p><ul><li>Place: store data about the farm, its features, its description and some relevant info.</li><li>Certificate: international certificates which the farm was awarded.</li><li>Feature: coffee rating made by a taster, the table includes ten features per farm.</li><li>History: information about the farm milestones.</li><li>Auth_user: all about the user who creates the profile, the farm is linked to him.</li><li>Product: characteristics of the main coffee offered by the farm.</li><li>Picture: store the path to the picture that will be shown in the profile.</li></ul><p>The relationship between the tables were defined in an Entity-Relationship model (ERM) as the following image</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*c2xa7IseoQKhr1iLzNVKYw.png" /><figcaption>ERM relationship model design</figcaption></figure><p>To design the ERM of Database for the MVP we chose these relationships to achieve a one-endpoint posting from the React server. A regular Django app is divided into separated apps, inside each app we can find the models that are represented in PostgreSQL tables. Those were divided by:</p><ul><li>Users app: User and Profile models</li><li>Products app: Product and Feature models</li><li>Places app: Farm, History, Certificate and Picture</li></ul><p>Each one of these models needs a view function, or <em>view</em> for short, that is a Python function that takes a Web request and returns a Web response. Django Rest Framework has Generic Views, a type of Class View that makes it easier to code responses. This snipset contains the model of generic views.</p><pre>class FarmsListView(generics.ListCreateAPIView):<br><br>   queryset = Farm.objects.all()<br><br>   serializer_class = FarmSerializer<br><br> <br><br>class FarmsView(generics.RetrieveUpdateDestroyAPIView):<br><br>   serializer_class = FarmSerializer<br><br>   queryset = Farm.objects.all()</pre><p>With ListCreateAPIView we can handle GET and MOST methods, while with RetrieveUpdateDestroyAPIView DELETE, PUT and PATCH methods. URLs or Endpoints are linked to views, and views are also linked to a Serializer.</p><p>Serializers allow complex data such as querysets and model instances to be converted to native Python data types that can then be easily rendered into JSON, so the API can be consumed using the HTTP Methods. Inside Places directory we created a file named serializers.py where we defined the way as the data is represented in JSON format. Each model and view have a serializer, and the serializer can be nested, so it is possible to POST to all models using one view.</p><pre>class ProductSerializer(serializers.ModelSerializer):<br><br>   class Meta:<br><br>       model = Product<br><br>       fields = (<br><br>           &#39;id&#39;,<br><br>           &#39;farm&#39;,<br><br>           &#39;coffeeName&#39;,<br><br>           &#39;description&#39;,<br><br>           &#39;price&#39;,<br><br>           &#39;variety&#39;,<br><br>           &#39;processing&#39;,<br><br>           &#39;crop_year&#39;,<br><br>       )<br><br>       read_only_fields = (&#39;farm&#39;, )</pre><p>We decided to POST all the information in the Farm view, due it is related to almost all models. The URL/endpoint for working is 127.0.0.1:8000/api/v1/farms/. We tested the API, as the following image shows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iKRFKtSpz_dXuXw0C_j1xQ.png" /><figcaption>JSON posting model</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JvkLbSXFNuaRp5ZHfXBX6g.png" /><figcaption>POST request Comodoro API</figcaption></figure><p>With this the first part of the backend development is finished with the integration of a native API and the next step is to integrate the API with the frontend using ReactJS.</p><h4><em>Frontend Stage</em></h4><p>Now, for the frontend design implementation, we used some design patterns from ReactJS. React uses a very different paradigm from the traditional HTML, CSS and JS because it uses components, these components rendered, uses something called JSX, which is an extension of the JS syntax, it is a sort of mixture between html and JS. ReactJS have many advantages like the reusability of components and because it has a better performance when handling states, so when some of the components in the frontend change, it won’t affect the entire DOM.</p><p>In this stage of development, our main challenge was learning how to use ReactJS. This library is constantly changing, so even when the library itself had a lot of new concept for learn for program some block of code, at the same time there were other ways to do the same thing because of the constant improvement of the library i.e. We used hooks, promises and some React components, for some parts of the code, and these pieces of code not necessarily have to be correlated. It is normal to see this in some React projects because new features are added to the library.</p><p>The most complex view in Comodoro’s web page is the Farm Form page, which is the place where the farmers are able to create their profiles. It has some fields where the user put the information, also pictures. If the architecture of Commodoro were monolithic, input this information would be easier due the nature of a backend created for example in NodeJS would permit the information to be stored in the same layer of the code pattern. However, as explained before, we set a couple of objectives to make a solid platform so we saw in Python along with Django REST the right approach to handle the data from the users without compromise security and reliability of it. To accomplish this implementation basically the main component has a state where all attributes are stored, we created one key for each input space. It was designed so every field in the form must be filled, when this happen, the data is sent to the API in two steps.</p><ol><li>Images: we decided to send first the image for simplicity, when the user post successfully an image to the backend, our application will receive a response with the current image path in the API server, so other models can store this information.</li><li>Farm Post: it is a complex form that includes different models, with a single post we could create all the necessary relations for a Farm in the database. All information was loaded in a state when the form was completely filled, then we make the post.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aIJ8wukjm5GFvYtCaxhRHw.gif" /><figcaption>Commodoro form</figcaption></figure><p>To support this task there were used AXIOS a tool that routed the information in JSON for other languages, but along with the API the information needed to have the same structure so there were no conflicts at the moment of store it in the database. After this action of POST, the information in the Farm form view, the user will be redirected to the new created profile with the corresponding information.</p><h4><em>Web infrastructure stage</em></h4><p>This stage is currently in development. As mentioned before, the team decided to handle cooperatively each main activity to get a viable MVP, therefore backend and frontend were the stages that took in development most of the five weeks to have the MVP. However, the team is still on track according the timeline and it has been containerizing the base code in two separated containers. In one container it was created the image of the backend base code, a second container is being implemented with the frontend code and a third container is being created to work as a database slave for new the data information of users.</p><p>It is important to recall that the Frontend container is going to have an extra configuration were a Nginx image is installed so it can be deployed to a domain already acquired <a href="https://commodoro.co/">https://commodoro.co</a>. When the three containers are uploaded into Docker hub, the next step is to synchronize these containers with the google cloud platform and create the Kubernetes console in which the containers are going to be transformed into nodes according the Kubernetes paradigm. The advantage of implementing Kubernetes in this stage is that this technology allows a native load balancing of the nodes, that means that if the team wants can create a replica container of the frontend and backend and configure it in a way that if a traffic overload or unexpected shutdown of the page occurs either for a code that is being refactored or implemented, the replica will be activated and the page won’t be offline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nN6SctXNnFMKINpxJIRReA.png" /><figcaption>Dockerfile used for backend staging</figcaption></figure><p>This feature that the team is aiming to achieve in the implementation is not easy to get, that is why the week 6 is being used for add this feature and ensure the reliability of Commodoro’s site due there will be a continuous integration and the idea is to made some test applying chaos engineering into the code itself.</p><h3>The product</h3><p>Here, is when all the process to get the MVP is completed. Commodoro achieved on time the creation of a platform that has a nice UX/UI and is aligned with the objectives proposed. The following video is the demo of the Commodoro web application and basically the coffee farmer is ready to create their farm as well as any user can see it.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FDxTY1YOru3g%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DDxTY1YOru3g&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FDxTY1YOru3g%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/22df2c50426eb61a3659f4c51f9852b1/href">https://medium.com/media/22df2c50426eb61a3659f4c51f9852b1/href</a></iframe><p>We also have this landing page for the launching of Commodoro if you want to know more about the project and the journey behind of it.</p><p><a href="https://edward0rtiz.github.io/commodoro_lp/">Commmodoro Landing Page</a></p><h3>The next steps</h3><p>For Commodoro team we aim to extend the features of the web application are the following list we mentioned the TODOS as part of the phase 2 of Commodoro.</p><ul><li>Commodoro Cocoa, Avocado: One our main goals are to reach many farmers as possible so they can reach more customers and have a fair trade for what they produce. Therefore, we are going to add the feature of register farms from other commodities such as Cocoa and Avocado.</li><li>Farm data visualization: We are going to take the data of the farmers to create and improve the visualization of their profile by adding more graphical data visualization of the performance of their farms. This will not only provide more accurate information to clients but also will provide insights of the farm performance for the farmers.</li><li>Decentralized transactions ESCROW: We are going to implement a decentralized payment microservice based on ESCROW contracts so farmers and clients have the security of a transaction and delivery of the product. This microservice is going to be built in python</li><li>Logistics tracking microservice: To support the scope of the payment microservice, Commodoro is going to implement an API of a Logistics company so the order can be tracked in real time as well as the status of the transaction</li></ul><h3>Conclusions</h3><ul><li>In order to manage larger variables independently and heading for a future implementation of data analytics, we developed a nested multi-layer serialization in our API. Now, it’s easier to GET and the integration with components in ReactJS to achieve this, we had to understand complex relationship between models in our DB.</li><li>We decided to use ReactJS for their components and capability to handle complex methods without sacrifice UI/UX. However, the paradigm of this library as well as the Hooks and Promises concepts were harder to understand with a python implementation.</li><li>Implementing a POST request in REACTJS that can manage the multiple layer serialization in our API was a challenge that took 40% of the total project. In order to successfully post the data in the form to the API we had to use AXIOS and transform the input data into keys so the API can receive the data properly.</li></ul><p>Finally, this last conclusion is not a technical one. We as team believed in the first moment of our member’s skills and take the leap to create something from nothing to design, program and deploy a full stack application. We encourage people who are passionate to also take a leap and think in a technological sustainable solution. Some may say that everything is already created and there is no need to do nothing more but there are unlimited opportunities in which your knowledge and passion will create something that can create a solution for a niche.</p><p>Thanks for read. Hope you liked this blog, stay tuned for more articles either for share knowledge or experiences.</p><h3>The Team</h3><ul><li><a href="https://www.linkedin.com/in/ortizedward">Edward A Ortiz - Management PM-FI Consultant - Management Consulting | LinkedIn</a></li><li><a href="https://co.linkedin.com/in/carlos-molano-salazar">Carlos Molano Salazar - Holberton School - Colombia | LinkedIn</a></li><li><a href="https://co.linkedin.com/in/david-peralta-52060a50">David Peralta - Full Stack Software Engineer and TA - Holberton School | LinkedIn</a></li></ul><h3>The Project</h3><p><a href="https://github.com/edward0rtiz/commodoro">edward0rtiz/commodoro</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec22668ec6b5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What happens when you type https://www.anypage.com in your browser and press Enter]]></title>
            <link>https://edward0rtiz.medium.com/what-happens-when-you-type-https-www-anypage-com-in-your-browser-and-press-enter-f92a8cb2ed53?source=rss-97dbe9327662------2</link>
            <guid isPermaLink="false">https://medium.com/p/f92a8cb2ed53</guid>
            <dc:creator><![CDATA[Edward Ortiz]]></dc:creator>
            <pubDate>Fri, 17 Jan 2020 16:28:15 GMT</pubDate>
            <atom:updated>2020-01-17T16:28:15.853Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Short description website interaction process</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FHtONToTC0Nx6y-AZCTZgQ.jpeg" /><figcaption>cartoon by Peter Steiner appeared in 1993</figcaption></figure><p>There has been a lot of talk about concepts like internet, www, https, infrastructure, etc; Behind those concepts there are actions that seem to be casual but there is a complex workflow behind these actions. One example is when you fill in your explorer bar any web page name. ie (google.com, facebook.com, holbertonschool.com, etc) and then you press enter.</p><p>We are going to make a study case of this action and try to understand the behavior behind this.</p><h4>To begin with…</h4><p>There are 3 key concepts that allow the completion of the action of typing any web page and press enter.</p><ol><li>Protocol: Known as communication protocol is a series of rules to transmit data between two devices. There is a conceptual model that defines de telecommunication between computers called Open System Interconnections (OSI)</li><li>Server: The server is a hardware or software that offer a service operation to other devices. In our example, the server provide the functionality to the computer hosting of the web site <a href="http://www.anypage.com/">www.anypage.com</a></li><li>Client: It is a hardware or software where an user can access to different services and functionalities hosted by a server. In other terms, the client can be the regular devices such as laptops, smartphones, etc in which we try to access internet services. The client in our study case is the web browser independently the device we are accessing from it.</li></ol><h4>The Workflow…</h4><p>The workflow of the study case are composed of 8 steps.</p><blockquote>URL parsing</blockquote><blockquote>DNS lookup</blockquote><blockquote>TCP/IP</blockquote><blockquote>SSL (optional)</blockquote><blockquote>LB (Load Balancer)</blockquote><blockquote>Firewall (optional)</blockquote><blockquote>Host server</blockquote><blockquote>Page Rendering</blockquote><ul><li><strong><em>URL parsing:</em></strong> It is when is taken a string of text and the return is the the web page assigned to it. Be careful that web browsers works under IP addresses (address redirected to servers). The IP addresses are numbered like 191.1.1.0 and can be transformed into domain names under the name + .com / .co / .net, and others. The domain name is part of the DNS (Domain Name System), therefore makes the web usage comprehensive for the society. Therefore, the parsing of the URL can be presented as this:</li></ul><blockquote><a href="https://google.com/about"><strong>https://google.com/about</strong></a><strong> == protocol://hostname:port/path-of-file</strong></blockquote><ul><li><strong>DNS lookup:</strong> It is the process when the resolver contacts both the top-level domain server “.com” and domain registrar before successfully resolving the hostname into its corresponding IP address. Check this interactive website to know more about DNS lookup. <a href="https://howdns.works/">How DNS Works</a>.</li><li><strong>TCP / IP:</strong> When the IP is resolved and its associated with the domain i.e “www.anypage.com” The web browser begins the communication with the corresponding server. The process of communication between the browser and server is called (TCP/IP) Transmission Control Protocol/Internet Protocol. This process has become an standard to the workflow of domain lookup.</li><li><strong>SSL:</strong> This is known as Secure Socket Layer and has been developed as protocol to cypher and compress data securely. As today you may find many web sites under the protocol “HTTPS” where the “S” means the symmetric cryptography encryption method used to keep communicated data <em>private</em>, <em>authenticated</em>, and <em>reliable. </em>Then, the interaction of the web browser with the IP becomes a secure process of verification and access of data.</li><li>HTTPS: Years ago the protocol HTTP (HyperText Transfer Protocol) ruled over all internet being stateless, asymmetric request-response client-server protocol that over TCP/IP. With the implementation of the SSL the communication between computers over the internet changed and despite maintaining the same structure (see image below) the protocol contains a new layer encrypted to increase the external inference of accessing data.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yw6tprDSYWmTc7OWkOr3_A.png" /><figcaption>Common HTTP Request body content</figcaption></figure><ul><li><strong>LB (Load Balancer): </strong>As today there are in average 3.8 billion people who is accessing internet per day and that means that the requests over HTTP in any website is by thousands per second. Handling such quantities of requests per second easily can overload the servers. The load balancer is an intermediary responsible for handling this traffic-splitting work. The LB is a software or hardware that can be configured either on the same server as that hosting web content or on a server all its own. <a href="https://www.haproxy.org/">HAProxy</a> is the most used LB in the market right now.</li><li><strong>Firewall: </strong>It can be a software or hardware supporting the idea of security behind the SSL that filter all traffic coming into and out of a server. While the TLS is effective for preventing data from being intercepted mid-transmission the firewall utilize a combination of packet filters, application gateways, circuit-level gateways and proxy servers to make certain that a packet does not contain viruses or malicious hardware.</li><li><strong>Host Server: </strong>The host server functionality is to feed and deliver the web page. The host server is a web stack consisting of multiple parts that is traditionally set up along the lines of what is termed the <a href="https://en.wikipedia.org/wiki/LAMP_%28software_bundle%29">LAMP</a> model. The LAMP model stands for (Linux, Apache, MySQL, PHP) Each part of this LAMP web stack can be configured separately, or all on the same server.</li><li><strong>Page Rendering: </strong>It is the final process of the web browser receiving the web page. Once the HTML of the web page is configured to the domain the host server sent the request to the web browser and the response received is a status code either was successful or failed.</li></ul><h4>References</h4><ul><li><a href="https://howdns.works/">How DNS works. What is DNS? Learn how step by step.</a></li><li><a href="https://en.wikipedia.org/wiki/User_Datagram_Protocol">User Datagram Protocol - Wikipedia</a></li><li><a href="https://www.ntu.edu.sg/home/ehchua/programming/webprogramming/http_basics.html">In Introduction to HTTP Basics</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f92a8cb2ed53" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Welcome to the IoT world]]></title>
            <link>https://edward0rtiz.medium.com/welcome-to-the-iot-world-7024d480d870?source=rss-97dbe9327662------2</link>
            <guid isPermaLink="false">https://medium.com/p/7024d480d870</guid>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[self-driving-cars]]></category>
            <category><![CDATA[smart-cities]]></category>
            <category><![CDATA[internet-of-things]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Edward Ortiz]]></dc:creator>
            <pubDate>Thu, 28 Nov 2019 03:36:07 GMT</pubDate>
            <atom:updated>2019-11-28T03:36:07.470Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*do19SI8pHb3QLvnAihDZKA.jpeg" /><figcaption>Image credit: Tom Fish Burne</figcaption></figure><h4>A brief story about the IoT and how it changed the way we lived</h4><p>If you are part of the baby boomer generation, gen x, millennial or gen z and want to know about IoT without getting bored this post is for you. This blog won’t take complex information and will try at max to get your attention in the way technology has changed our lives and how it will keep it changing.</p><p>So let’s get started…</p><h3>A travel in time</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/1*SunYMjNYcJQo6fx02Tfu2w.jpeg" /><figcaption>Image credit: Zebactive</figcaption></figure><p>To talk about IoT we must first go back on time 20 years when internet started to revolutionize our lives, but don’t get scared, I am not going to start to explain the history of the internet, protocols and complex things like that. In fact, the only thing you need to be present for now is that 20 years ago the internet connection were at a average speed of 56Kbps (today average speed of connection in U.S is 18.75Mbps). And what does it mean? it means that back in time when a user wanted to open a website it could take several seconds and even minutes depending the access of connection, webpage quantity of information and elements. The internet was revolutionary in away to accessing information, but it was limited in ways that can not connect more solutions to the users and society in general.</p><p>However, over the time the development of new technologies offered better quality and speed of internet; so opening a website could take less than a second and people also were available to connect devices such as cellphones, printers, TV, cameras, etc to the internet. This breakthrough moment when the speed of internet were exceeding expectations, led to hardware companies to develop solutions integrating functionality and connection to the internet was the entry point for IoT in millions of people.</p><h3>What is IoT?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/1*toKwHpHTNXafD2FFh-vh4g.jpeg" /><figcaption>Image credit: Google</figcaption></figure><p>IoT is the acronym for Internet of Things and despite is now widely a popular word, back in time (1982) even before commercial internet, scientists, academics and tech pioneers were thinking about a network connection of smarter devices. Those key words <em>smarter devices </em>is the core of IoT.</p><p>Then, to define IoT it is the consolidation through the network of networks of a “network” the hosting of a large number of objects or devices, in order to have integrated as much as things as possible such as vehicles, appliances, mechanical devices, or simply objects like footwear, furniture, suitcases, measuring devices, biosensors, or any object that we can imagine.</p><h3>Why IoT?</h3><p>IoT in this moment is innovating in many ways lifestyle from regular to corporate consumers by allowing the users to manage and monitor their operations. So the user can have local and remote control over their devices, feeding them with information to create usage patterns and have a traceability over their daily activities.</p><p>The Internet of Things is a concept that is based on the interconnection of any product with any others around it. Take as example the connection between a speaker in you living room with the lamp of your studio. One premise of the IoT is that as long the devices are compatible to communicate with each other the independence in your actions and interaction with technology will be more efficient. But in order to achieve this, one important thing is to have IPv6 protocol which is a network layer protocol that enables data communications over a machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/1*luNO5-_TDFT-utREDUOtNQ.jpeg" /><figcaption>Image credit: Zebactive</figcaption></figure><blockquote>As long the devices are compatible to communicate with each other the independence in your actions and interaction with technology will be more efficient</blockquote><h3>It is possible to connect everything to the network?</h3><p>In short, yes. At this moment the internet speed allows manufactures to create devices that can be connected permanently to the internet and the user can have information and use remotely if he wants. However, right now there are still some devices that are not intended to be connected yet, or it is required a more stable protocol. Imagine for example a smart jacket where the user can control the temperature of the jacket from the smartphone. So, as long the connection technology keeps evolving more devices and more appliances are going to be launched to the market.</p><h3>Where to find IoT?</h3><p>IoT devices now can be found almost everywhere. we are going to see 3 examples from 3 different areas in which IoT is having a development and a trending of consumption from comercial users to corporate ones.</p><h4>Autonomous cars</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*wTe8s7Tvp9hzeXtVw-dLGQ.gif" /><figcaption>Tesla Cyertruck</figcaption></figure><p>Automation in cars was conceived around the 1920’s and official trials began in 1950’s over the years many companies has been testing and even now are in production cars with a certain capability of being self d-driven. Thanks IoT companies such as Toyota, Volvo, Telsa, BMW, Audi and others are investing time and resources in to make cars automated by implementing technologies such as:</p><ul><li><strong>Connectivity:</strong> reliability in transferring data between the user and the car.</li><li><strong>Homogenization and decoupling:</strong> sending and receiver information to the car in the same form.</li><li><strong>Reprogrammable:</strong> implementing compatible software that can be modified easily by the user and the manufacturer all by maintaining the synchronization with the components of the car such as the transmission, engine, brakes, etc.</li><li><strong>Digital traces:</strong> Implementation of sensors and radars that can be connected and iteroperate with the master computer of the vehicle.</li></ul><p>All this applied technologies in the autonomous vehicles has led the user to have some autonomy over the vehicle manipulation, such as not using psychically the wheel when there is defined trajectory over a point <em>a</em> or <em>b</em> while the car is collecting data to perform the actions of accelerate the car steer the wheel in certain direction and track the surrounding for humans or obstacles in order to avoid an accident. Nevertheless, the technology around autonomous cars is not yet fully completed and there has been some record of accidents but even so the projections for make the vehicles fully autonomous is in a near future.</p><h4>Smart Cities</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*iKcgjrO9vncExmYYXSw6dQ.png" /><figcaption>Image credit I-policies.org</figcaption></figure><p>Along the development of intelligent vehicles, the concept of smart cities has taken a strong echo in the current society promoted by private companies in collaboration with academics and government institutions.</p><p>IoT in the city means the use of devices for the people use, such as traffic lights, security cameras, transportation monitoring to be more efficient and can by tracking the patterns of the society flux perform complex tasks like controlling the traffic reducing probability of jams, increasing security over criminal actions. Currently the best example of IoT in cites is the autonomous control of traffic lights when there aren’t cars passing by a street and there are people wanting to cross the line, the improvement of this technology eases the traffic of pedestrians.</p><h4>Wearable devices</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*vQmgmiL-sA_WoaXvz_3fOA.jpeg" /><figcaption>James Bond watch at The Spy who loved me</figcaption></figure><p>The most common IoT appliances are the everyday devices like, watches, speakers, house lights. These devices has become smart thanks to the market demand and the research from several years from companies focused in selling those kind of consumable products. For example, smart watches of today can be connected to the internet, exchange data with external servers collecting information from both the sensors and the servers.</p><h3>Is the IoT intelligent?</h3><p>The fact that with IoT you can connect devices to a network, get a response from them and use the collected information to analyze data, means that these devices can be upgraded to a level in which by using Machine Learning or Artificial intelligence the devices can perform better having a smart operation. So the IoT devices at some point can achieve certain level of intelligence depending the purpose, how is build and the performance test made on them. But it is important to understand that there are 5 levels of intelligence:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*aylKvtSXCcQVJbDjF56CVg.gif" /><figcaption>The Westworld HBO</figcaption></figure><ul><li><strong>L1 Identity:</strong> The object will be able to identify itself in a unique way</li><li><strong>L2 Location:</strong> You will know where that object is or where it has been.</li><li><strong>L3 State:</strong> It will be able to communicate the state it is in as well as its characteristics.</li><li><strong>L4 Context:</strong> The object will be able to perceive the environment in which it is located.</li><li><strong>L5 Criteria:</strong> The object communicates, identifies, locates, analyzes its environment, decides and executes according to its criteria.</li></ul><p>It may seem that these classification it’s outdated but it is the point of reference to understand the intelligence in IoT devices. So think about what smarter devices you already have and what level of intelligence has achieved for bring a solution to your life and is there an additional level <strong>(Ln+1) </strong>above the level 5 still for the humans to achieve with smarter devices?</p><h3><strong>The risks of IoT</strong></h3><p>Several companies have thousands of IoT devices (Internet of Things) that are not directly related to the business, but that connect to their network daily. When you have that situation a risk is raised and is the unauthorized control over these devices in a private/business network.</p><p>The more employees a company have that uses some device IoT the harder for the IT security department of the company will be to maintain the network secure from hacking or filtering information.</p><p>According to a company called Infoblox, a survey was made for 1,000 IT directors in the U.K, Germany, US. and UAE to understand the security implications of IoT devices owned by their employees connected to the company networks. The results were that with a 35% of the directors, the average quantity of personal IoT devices connected to business networks are around 5,000.</p><p>Also, 39% percent of respondents said they used personal IoT devices while connected to the corporate network to access social networks, 24% used these devices to download applications, while 13% did so to access their preferred games.</p><p>the study also presented that the most frequent devices connected to business networks are: physical activity trackers (Fitbit, gear Fit, etc), digital assistants (Google home, Amazon Alexa). because this kind of devices are connected permanently to the user to collect data and even more the password selection from the users is not the most reliable, the risk of filtering information via the business network is high.</p><p>These types of vulnerabilities in IoT devices is a new task that IT departments need to work on, so the security of the company won’t be compromised.</p><h3>In short…</h3><p>IoT is a topic that has been around us for decades and covering all the information of it is basically either or make a book or spend several hours searching on the web. But, the idea of this blog is that at the end of this you have understood that you already are using an IoT device that in order to accomplish their purpose it is gathering data to create information and deliver statistics so you can make choices to improve your lifestyle.</p><p>Indeed there are risks like the privacy access and network vulnerability that makes you think if there is worth to use these kind of devices but at the end ver the time the technology is improving these kind of issues with continuous updates so the user can feel secure. Also is a responsibility of you as user to set a strong password and try to keep those devices connected to a secure network that is not from your company.</p><p>IoT is here to stay and inevitably over the years we as society are going to be more immersed into a technological one so by having a knowledge of how these things works we can have a better control over the use of IoT devices.</p><h3>References</h3><ul><li><a href="https://www.infoblox.com/infoblox-research-finds-explosion-of-personal-and-iot-devices-on-enterprise-networks-introduces-immense-security-risk/">Infoblox Research Finds Explosion Of Personal And IoT Devices On Enterprise Networks Introduces Immense Security Risk - Infoblox</a></li><li><a href="https://www.i-policy.org/2018/07/exploring-iot-applications-for-smart-cities-of-different-sizes.html">Exploring IoT applications for smart cities of different sizes</a></li><li><a href="https://zigbee.org/">Zigbee Alliance</a></li><li><a href="https://www.domodesk.com/">Todo en domótica de fácil instalación</a></li><li><a href="https://en.wikipedia.org/wiki/Internet_of_things">Internet of things - Wikipedia</a></li><li><a href="https://www.ibm.com/blogs/internet-of-things/what-is-the-iot/">What is the Internet of Things, and how does it work?</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7024d480d870" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>