<?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 Merve Noyan on Medium]]></title>
        <description><![CDATA[Stories by Merve Noyan on Medium]]></description>
        <link>https://medium.com/@merveenoyan?source=rss-763008f53ee9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*zW4mUQSjHBHYZyix0iJ19Q@2x.jpeg</url>
            <title>Stories by Merve Noyan on Medium</title>
            <link>https://medium.com/@merveenoyan?source=rss-763008f53ee9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 19 Apr 2026 15:25:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@merveenoyan/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[Open-Source Text Generation & Conversational AI Ecosystem in Hugging Face]]></title>
            <link>https://merveenoyan.medium.com/open-source-text-generation-conversational-ai-ecosystem-in-hugging-face-39f1def88636?source=rss-763008f53ee9------2</link>
            <guid isPermaLink="false">https://medium.com/p/39f1def88636</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[conversational-ai]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Merve Noyan]]></dc:creator>
            <pubDate>Fri, 23 Jun 2023 11:23:18 GMT</pubDate>
            <atom:updated>2023-06-23T11:24:56.732Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Photo by Yuriy Kovalev on Unsplash" src="https://cdn-images-1.medium.com/max/1024/0*MnKnXTApE651hibG" /></figure><p>Text generation and conversational technologies has been around for ages. With the recent boom of text generation models like GPT-4 and open-source alternatives (Falcon, MPT and more!) going mainstream, these technologies will be around and more integrated into every day products. In this post, I’ll go through a brief background on how they work, the types of text generation models and the tools in Hugging Face ecosystem that enable building products using open-source alternatives, challenges, questions and how we respond them.</p><p><strong>Small Background on Text Generation</strong></p><p>Text generation models are essentially trained with an objective of completing text. Earlier challenges in working with these models were controlling both the coherence and diversity of the text through inference parameters and the discriminative biases. The outputs that sounded more coherent were less creative and closer to the original training data, and wouldn’t sound like something that would be said by a human. Recent developments overcame these challenges, and user friendly UIs enabled everyone to try these models out.</p><p>Having more variation of open-source text generation models enables companies to keep privacy with their data (one of their intellectual properties!), ability to adapt models to their domains quicker and cut costs for inference instead of relying on closed paid APIs.</p><p>Simply put, these models are firstly trained with the objective of text completion, and later optimized using a process called reinforcement learning from human feedback. This optimization is mainly made over how natural and coherent the text sounds, rather than validity of the answer. You can get more information about this process <a href="https://huggingface.co/blog/rlhf">here</a>. In this post, we will not go through the details of this.</p><p>One thing you need to know about before we move on, is fine-tuning. This is the process of taking a very large model and transfer the knowledge contained this model to the use case, a downstream task. This tasks can come in form of instructions. As the model size grows, the models can generalize better to the instructions that do not exist in the fine-tuning data.</p><p>As of now, there’s two main types of text generation models. Models that complete the text are referred as Causal Language Models and can be seen below. Most known examples are GPT-3 and BLOOM. These models are trained with bunch of texts where latter part of the text is masked such that the model can complete the given text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*UBVrCtdBQt-UwNR9R8OrDA.png" /></figure><p>All causal language models on Hugging Face Hub can be found <a href="https://huggingface.co/models?pipeline_tag=text-generation">here</a>.</p><p>Second type of text generation models is commonly referred as text-to-text generation models. These models are trained on text pairs, which can be questions and answers, or instructions and responses. The most popular ones are T5 and BART (which as of now aren’t state-of-the art). Google has recently released FLAN-T5 series of models. FLAN is a recent technique developed for instruction fine-tuning, and FLAN-T5 is essentially T5 fine-tuned using FLAN. As of now, FLAN-T5 series of models are state-of-the-art and open-source, available on <a href="https://huggingface.co/models?search=google/flan">Hugging Face Hub</a>. Below you can see an illustration of how these models work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UBtE3hT35cpYJtbX.png" /><figcaption>Picture taken from FLAN-T5</figcaption></figure><p>The model GPT-3 itself is a causal language model, and the models in the backend of the ChatGPT (which is the UI for GPT-series models) are fine-tuned on prompts that can consist of conversations or instructions through RLHF. It’s an important distinction to make between these models. On Hugging Face Hub, you can find both causal language models, text-to-text models, and causal language models fine-tuned on instruction (which we’ll give links to later in this blog post).</p><p>Snippets to use these models are given in either the model repository, or the documentation page of that model type in Hugging Face.</p><p><strong>Licensing</strong></p><p>Most of the available text generation models are either closed-source or the license limits commercial use. As of now, <a href="https://huggingface.co/mosaicml/mpt-30b">MPT-3</a> and <a href="https://huggingface.co/tiiuae/falcon-40b">Falcon</a> models are fully open-source, and have open-source friendly licenses (Apache 2.0) that allow commercial use. These models are causal language models. There are versions fine-tuned on various instruction datasets that exist on Hugging Face Hub that come in various sizes depending on your needs.</p><p><a href="https://huggingface.co/mosaicml/mpt-30b-chat">MPT-30B-Chat</a> has CC-BY-NC-SA license (for non-commercial use) and , <a href="https://huggingface.co/mosaicml/mpt-30b-instruct">MPT-30B-Instruct</a> has CC-BY-SA 3.0 that can be used commercially respectively. <a href="https://huggingface.co/tiiuae/falcon-7b-instruct">Falcon-7B-Instruct</a> has Apache 2.0 license that allows commercial use. Another popular model is OpenAssistant, built on LLaMa model of Meta. LLaMa has restrictive license and due to this, OpenAssistant checkpoints built on LLaMa don’t have fully open-source licenses, but there are other OpenAssistant models built on open-source models like <a href="https://huggingface.co/models?search=openassistant/falcon">Falcon</a> or <a href="https://huggingface.co/models?search=openassistant/pythia">pythia</a> that can be used.</p><p>Some of the existing instruction datasets are either crowd-sourced or use outputs of existing models (e.g. the models behind ChatGPT). ALPACA dataset created by Stanford is created through the outputs of models behind ChatGPT, which OpenAI doesn’t allow using when training models. Moreover, there are various crowd-sourced instruction datasets with open-source licenses, like <a href="https://huggingface.co/datasets/OpenAssistant/oasst1">oasst1</a> (created by thousands of people voluntarily!) or <a href="https://huggingface.co/datasets/databricks/databricks-dolly-15k">databricks/databricks-dolly-15k</a>. Models fine-tuned on these datasets can be distributed.</p><p><strong>How can you use these models?</strong></p><p>Response times and handling concurrent users remain a challenge for serving these models. For this, Hugging Face has released <a href="https://github.com/huggingface/text-generation-inference">text-generation-inference</a> (TGI) it’s an open-source serving solution for large language models, built with Rust, Python and gRPc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dr8U1F4Yt-84LJa0Cgve9A.png" /><figcaption>Screenshot from Hugging Chat 🌈</figcaption></figure><p>TGI currently powers <a href="https://huggingface.co/chat/">HuggingChat</a>. HuggingChat is the chat UI for large language models. Currently it has OpenAssistant on backend. You can chat as much as you want with HuggingChat, and enable the search feature for validated responses. You can also give feedbacks to each response for model authors to train better models. The UI of HuggingChat is also <a href="https://github.com/huggingface/chat-ui">open-sourced</a> (yes 🤯) and soon, there will be a docker image release on <a href="https://huggingface.co/spaces">Hugging Face Spaces</a> (app store of machine learning) so you can have your very own HuggingChat instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fSfpwKO221K9o2ds_y1BEQ.png" /></figure><p><strong>How to find the best model as of now?</strong></p><p>Hugging Face hosts an LLM leaderboard <a href="https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard">here</a>. This leaderboard is created by people uploading models, and metrics that evaluate text generation task are calculated on Hugging Face’s clusters and later added to leaderboard. If you can’t find the language or domain you’re looking for, you can filter them <a href="https://huggingface.co/models?pipeline_tag=text-generation&amp;sort=downloads">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kdDcXeFsSVjw4iTAt9MWwQ.png" /></figure><p><strong>Models created with love by Hugging Face with BigScience and BigCode</strong></p><p>Hugging Face has two main large language models, <a href="https://huggingface.co/bigscience/bloom">BLOOM</a> 🌸 and <a href="https://huggingface.co/bigcode/starcoder">StarCoder</a>🌟. StarCoder is a causal language model trained on code from GitHub (with 80+ programming languages 🤯), it’s not fine-tuned on instructions and thus it serves more as a coding assistant to complete a given code, e.g. translate Python to C++, explain concepts (what’s recursion) or act as a terminal. You can try all of the StarCoder checkpoints in <a href="https://huggingface.co/spaces/bigcode/bigcode-playground">this application</a>. It also comes with a <a href="https://marketplace.visualstudio.com/items?itemName=HuggingFace.huggingface-vscode">VSCode extension</a>.</p><p>BLOOM is a causal language model trained on 46 languages and 13 programming languages. It it the first open-source model to have more parameters than GPT-3. You can find available checkpoints in <a href="https://huggingface.co/docs/transformers/model_doc/bloom">BLOOM documentation</a>.</p><p><strong>Bonus: Parameter Efficient Fine Tuning (PEFT)</strong></p><p>If you’d like to fine-tune one of the existing large models on your own instruction dataset, it is nearly impossible to do so on consumer hardware and later deploy them (since the instruction models are same size as original checkpoints that are used for fine-tuning). <a href="https://github.com/huggingface/peft">PEFT</a> is a library that allows you to fine-tune smaller part of the parameters for more efficiency. With PEFT, you can do low rank adaptation (LoRA), prefix tuning, prompt tuning and p-tuning.</p><p>This is all for this blog post, I’m planning to write down another one as new tools and models are being released. Please let me know what you think or build!</p><p><strong>Further Resources</strong></p><ul><li>AWS has released TGI based LLM deployment deep learning containers called LLM Inference Containers, read about them <a href="https://aws.amazon.com/tr/blogs/machine-learning/announcing-the-launch-of-new-hugging-face-llm-inference-containers-on-amazon-sagemaker/">here</a></li><li><a href="https://huggingface.co/tasks/text-generation">Text Generation task page</a> to find out more about the task itself</li><li>PEFT announcement <a href="https://huggingface.co/blog/peft">blog post</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39f1def88636" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Complete Guide on Deep Learning Architectures Part 2: Autoencoders]]></title>
            <link>https://merveenoyan.medium.com/complete-guide-on-deep-learning-architectures-part-2-autoencoders-293351bbe027?source=rss-763008f53ee9------2</link>
            <guid isPermaLink="false">https://medium.com/p/293351bbe027</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Merve Noyan]]></dc:creator>
            <pubDate>Sun, 11 Jun 2023 16:05:15 GMT</pubDate>
            <atom:updated>2023-06-11T16:05:15.074Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hQhM-0Vg3mhepFBR6YnMvg@2x.jpeg" /><figcaption>Photo by Daniele Levis Pelusi on Unsplash</figcaption></figure><h3>Autoencoder: Basic Ideas</h3><p>Autoencoder is the type of a neural network that reconstructs an input from the output. The basic idea here is that we have our inputs, and we compress those inputs in such a manner that we have the most important features to reconstruct it back.</p><p>As humans, when we’re asked to draw a tree with the least number of touches to the paper, (given that we’ve seen so many trees in our lifetime) we draw a line for the tree and couple of branches on top to provide an abstraction to how trees look like, this is what’s being done with autoencoder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*oEeRB1379pwMwIs-FhUj4g@2x.jpeg" /></figure><p>An average autoencoder looks like below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*uS5oZwfArv5uoHn4YxHL0w@2x.jpeg" /></figure><p>Let’s take a solid case for image reconstruction.</p><p>We have our input layer with 784 units (assuming we give 28x28 images) and we could simply stack a layer on top with 28 units, and our output layer will have 784 units again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*axGaAP8RaRunTukpUm40ww@2x.jpeg" /></figure><p>The first part is called “encoder” it encodes our inputs as latent variables, and second part is called “decoder” it will reconstruct our inputs from the latent variables.</p><p>The hidden layer having less number of units will be enough to do the compression and get latent variables. This is called “undercomplete autoencoder” (we also have other types of autoencoders but this gives the main idea, we’ll go over them as well). So in short, it’s just another feed forward neural network that has the following characteristics:</p><ul><li>input layer, hidden layer with less number of units and output layer</li><li>it’s unsupervised: we will pass our inputs, get the output and compare with input again</li><li>Our loss function will be comparing the input to compressed and then reconstructed version of the input and see if the model is successful or not.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*CG_KkuRV-OPYz-FYDdU5bw@2x.jpeg" /></figure><ul><li>An autoencoder that has a decoder with a linear layer essentially does the same thing as principal component analysis (even though training objective is to copy the input).</li><li>Another core concept of autoencoder is weight tying. The weights of decoder are tied to weights of encoder. When you transpose the weight matrix of encoder, you get the weights of decoder. It’s a common practice for decoder weights to be tied to encoder weights. This saves memory (using less parameters), and reduced overfitting. I tried to explain my intuition below in multiple graphics. Let’s take a look.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/1*5VHIQEj6XDXj2eZSsPztmQ@2x.jpeg" /></figure><p>For the autoencoder below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/1*ASGlljkrhhMu4Tkg5rGEaw@2x.jpeg" /></figure><p>Weight matrix of encoder and decoder looks like this (you can skip this if you know what transpose means):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mb9DlVmgqFKfUkWfOxrGyA@2x.jpeg" /></figure><h3>Keras Implementation</h3><p>Let’s implement above network using Keras Subclassing API. I left comments for each layer to walk you through how to create it.</p><pre><br>class Autoencoder(Model):<br><br>  def __init__(self, latent_dim):<br>    super(Autoencoder, self).__init__()<br>    self.latent_dim = latent_dim<br><br>	# define our encoder and decoder with Sequential API<br>	# flatten the image and pass to latent layer to encode<br>    self.encoder = tf.keras.Sequential([<br>      layers.Flatten(),<br>      layers.Dense(latent_dim, activation=’relu’),<br>    ])<br><br>	# reconstruct latent outputs with another dense layer<br>	# reshape back to image size<br>    self.decoder = tf.keras.Sequential([<br>      layers.Dense(784, activation=’sigmoid’),<br>      layers.Reshape((28, 28))<br>    ])<br><br>	# give input to encoder and pass encoder outputs (latents) to decoder<br>  def call(self, x):<br>    encoded = self.encoder(x)<br>    decoded = self.decoder(encoded)<br>    return decoded<br><br># initialize model with latent dimension of 128<br>autoencoder = Autoencoder(128)<br><br># we can use simple MSE loss to compare input with reconstruction<br>autoencoder.compile(optimizer=’adam’, loss=losses.MeanSquaredError())<br><br># we don’t have a y_train given we want output to be same as input :) <br>autoencoder.fit(x_train, x_train,<br>                epochs=10,<br>                shuffle=True,<br>                validation_data=(x_test, x_test))</pre><p>In contrast to undercomplete autoencoder, complete autoencoder has equal units, and overcomplete autoencoder has more units in latent dimension compared to encoder and deocder. This causes the model to not learn anything but rather overfit. In undercomplete autoencoders on the other hand, the encoder and decoder might be overcapacitated with information if hidden layer is too small. To avoid overengineering this and add more functionalities to autoencoders, regularized autoencoders are introduced. These models have different loss functions that not only copy input to output, but make the model more robust to noisy, sparse or missing data. There are two types of regularized autoencoders, called denoising autoencoder and sparse autoencoder. We will not go through them in depth in this post since implementation doesn’t differ a lot from the normal autoencoder.</p><h3>Sparse Autoencoder</h3><p>Sparse autoencoders are autoencoders that have loss functions with a penalty for latent dimension (added to encoder output) on top of the reconstruction loss. These sparse features can be used to make the problem supervised, where the outputs depend on those features. This way, autoencoders can be used for problems like classification.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*hG7lGmkK_jdytNnLW2mEnA@2x.jpeg" /></figure><h3>Denoising Autoencoder</h3><p>Denoising autoencoders are type of autoencoders that remove the noise from a given input. To do this, we simply train the autoencoder with corrupted version of input with a noise and ask the model to output the original version of the input that doesn’t have the noise. You can see the comparison of loss functions below. The implementation of this is same as normal autoencoder, except for the input.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RqUI7WXAb89UQLYlw8ghTg@2x.jpeg" /></figure><h3>Stacked Autoencoder</h3><p>Before ReLU existed, vanishing gradients would make it impossible to train deep neural networks. For this, stacked autoencoders were created as a hacky workaround. One autoencoder was trained to learn the features of the training data, and then the decoder layer was cut and another encoder is added on top and the new network is trained. At the end, softmax layer was added to use these features for classification. This could be one of the early techniques to do transfer learning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F5oRdkNGCaCjm0vfpJgjGQ@2x.jpeg" /></figure><p>There are variational autoencoders and other types heavily used in generative AI. I will go through them in another blog post. Thanks a lot if you’ve read this far and let me know if there’s anything I can improve :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=293351bbe027" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Açık Yazılım Ağı’nda Geliştirdiğimiz Makine Öğrenmesi Uygulamaları]]></title>
            <link>https://merveenoyan.medium.com/a%C3%A7%C4%B1k-yaz%C4%B1l%C4%B1m-a%C4%9F%C4%B1nda-geli%C5%9Ftirdi%C4%9Fimi-makine-%C3%B6%C4%9Frenmesi-uygulamalar%C4%B1-dbbe10d7f736?source=rss-763008f53ee9------2</link>
            <guid isPermaLink="false">https://medium.com/p/dbbe10d7f736</guid>
            <dc:creator><![CDATA[Merve Noyan]]></dc:creator>
            <pubDate>Mon, 27 Feb 2023 15:19:02 GMT</pubDate>
            <atom:updated>2023-03-28T21:14:01.152Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fLj-X_dD84ieLdez0UHSNQ.png" /><figcaption>afetharita arayüzü</figcaption></figure><blockquote>Yazarlar: Merve Noyan &amp; Alara Dirik</blockquote><p>This blog contains the applications we developed for disaster response. You can find the English version here 👉 <a href="https://huggingface.co/blog/using-ml-for-disasters">https://huggingface.co/blog/using-ml-for-disasters</a></p><p>6 Şubat 2023&#39;te Güneydoğu Türkiye’yi vuran 7,7 ve 7,6 büyüklüğündeki depremler, 10 ili etkiledi ve 21 Şubat itibarıyla 42.000&#39;den fazla ölüm ve 120.000&#39;den fazla yaralanmayla sonuçlandı. Depremden saatler <strong>Açık Yazılım Ağı</strong> Discord sunucusunda kurtarma ekiplerine, depremzedelere ve yardım etmek isteyenlere kaynak olabilecek bir proje geliştirmeye başladık: <strong>afetharita.com</strong>. Depremin ilk gününde depremzedelerin yardım çağrılarının yazılı şekilde instagram hikayesi ya da tweet olarak paylaştıklarını gözlemledik. Bu verileri otomatik olarak çekip anlamlı hale getirmenin yollarını aradık ve bir yandan zamanla yarışmak zorunda kaldık. Bu blog yazısında oluşturduğumuz uygulamaları ve geliştirme süreçlerinde izlediğimiz yolları anlatacağız.</p><p>Discord sunucusuna davet edildiğimde nasıl çalışacağımız ve ne yapacağımız konusunda oldukça fazla kaos vardı. Bilgi almak ve işlemek için makine öğrenimi tabanlı uygulamalar oluşturmak istediğimize ve ayrıca modeller ve verisetleri için bir registry’e ihtiyacımız olduğuna karar verdiğimiz için aşağıdaki Hugging Face organizasyon hesabını açtık. Eğittiğimiz modeller, kişisel veri içermeyen veri setleri ve uygulamalarımız hala bu hesapta bulunuyor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S7rO7vI8Ky-0ek1jPWnGCw.png" /></figure><p>İlk gün insanların paylaştıkları instagram hikayelerinden ya da twitter’da bu hikaye ekran görüntülerinden bilgi çekip, yapılandırıp, bir veritabanına yazma ihtiyacımız doğdu. Çeşitli açık kaynaklı OCR (optik karakter tanıma) araçlarını denedikten sonra, bu uygulamayı geliştirmek için easyocr ve arayüz için Gradio’yu kullanmaya başladık ekiplerin OCR’den yararlanabilmesi için arayüzden API endpoint’leri açtık. Bu uygulamaya gelen ekran görüntülerinden OCR ile metinleri çekip ardından bu metinlerden aşağıda değineceğim açık kaynaklı kendi eğittiğimiz adres modelini kullanarak adresleri, isimleri ve telefon numaralarını çekip veritabanına yazdık.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pBKgr59FyngTDe6m5xZ5CA.png" /></figure><p>Daha sonra, çeşitli kanallardan yardım çağrısında bulunan depremzedelerin adreslerini ve kişisel bilgilerini (daha sonra anonim hale getirildi) içeren etiketli veri bize verildi. Hem kapalı kaynak modellerin birkaç adımlık yönlendirmesiyle (few-shot learning) hem de transformers kütüphanesiyle kendi adres çekme modelimizi eğiterek denemeye başladık. Bunun için baz model olarak <a href="https://huggingface.co/dbmdz/bert-base-turkish-cased">dbmdz/bert-base-turkish-cased</a> kullandık ve ilk adres çıkarma modelini eğitmiş olduk.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xv1Vk8QS9L9byx9IYB9Csg.png" /></figure><p>Model daha sonra adresleri ayrıştırmak için “afetharita”da kullanıldı. Daha sonra, ayrıştırılan adresler coğrafi kodlama API’sine iletilecek, boylam ve enlem alınacak ve bunları arayüzde gösterilmek üzere dağıtacak olan backend’e gidecekti. Bu modeli inference’a açık şekilde host etmek için Hugging Face’in hazır inference API’sini kullandık. Bu bizi modeli çekip üstüne FastAPI uygulaması yazıp docker görüntüsü oluşturmaktan, her deployment için CI/CD kurmaktan ve sonrasında buluta koymaktan kurtardı.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7SXxTYRkxCLrx-d64nH-Xg.png" /></figure><p>Daha sonra, elimizdeki verilerden depremzedelerin ihtiyaçlarını sınıflandırmak için niyet sınıflandırma modeli eğitmemiz istendi. Her tweet’te birden fazla ihtiyaç vardı. Bu ihtiyaçlara örnek barınak, yiyecek, ya da lojistik olabilir. İlk olarak Hugging Face Hub’da açık kaynaklı NLI modelleri ile zero-shot prompting denemeleri ve OpenAI davinci endpoint’i ile few-shot prompting denemeleri yapmaya başladık. NLI modelleri, aday etiketlerle doğrudan çıkarım yapabildiğimiz ve veri kayması meydana geldikçe etiketleri değiştirebildiğimiz için özellikle kullanışlıydı. Davinci de iyi çalışıyordu, fakat çıktısını backend’e verirken olmayan etiketler uydurduğu için tercih etmedik. Sonrasında elimize etiketli veri geçtiği için, BERT fine-tune etmeye karar verdik. Deneylerimizin performansını model repository’lerindeki model kartının metadata kısmında not ettik, sonrasında lider tablosu oluşturduk.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o7gqpRecWdwUy9bqhFzouw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mLWmYr2lPmulh444kGiIMA.png" /></figure><p>Yanlış negatiflerin olmamasını çok önemsiyorduk (bir ihtiyacın olması fakat olmamış gibi gözükmesi durumu) ve sınıflarda dengesizlik vardı, bu nedenle bir recall ve F1 puanlarının macro average’ı üzerinden bir kıyaslama yaptık.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CI9IUy0EvpGjnZ-I6D6T6Q.png" /></figure><p>Eğitim setinde sızıntıyı önlemek ve modellerimizi tutarlı bir şekilde kıyaslamak için ayrı bir test seti oluşturduk. Bu problem çok etiketli sınıflandırma olduğu için modelin en iyi performans gösterdiği eşiği bulup not ettik ve üretimde hangi etiketin sepete gireceğini bulmak için bu eşiğe bağlı kaldık.</p><p>Veri etiketleyiciler bize daha doğru ve güncel verisetleri sağlamak için çalıştıklarından adres çekme modelimizin değerlendirilmesini crowdsourced hale getirmek istedik. Adres çekme modelini değerlendirmek için, Argilla ve Gradio kullanarak, insanların bir tweet girip çıktıyı doğru/yanlış/belirsiz olarak işaretleyebildiği bir etiketleme arayüzü kurduk.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tSV5-lWEiFr0WKqLFvpvMQ.png" /></figure><p>Daha sonra veri setindeki çiftleri çıkardık ve sonraki deneylerimizde modeli değerlendirmek için kullanmaya karar verdik.</p><p>Bunun dışında sonradan üretime aldığımız bir projemizde de OpenAI davinci‘yle few-shot denemeler yaparak her tweet’ten daha spesifik ihtiyaçları (bebek bezi, ilaç vb) çekip serbest metin olarak yazdık. Bu modeli FastAPI ile sarıp ardından buluta koyduk.</p><p>Adres ve ihtiyaç sınıflandırma modelleri an itibariyle gönüllülerin ve arama kurtarma ekiplerinin hayatta kalanlara ihtiyaçları ulaştırabilmesi için aşağıdaki ısı haritasındaki noktaları oluşturmak için üretimde kullanılıyor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fLj-X_dD84ieLdez0UHSNQ.png" /></figure><p>Adres tanıma ve amaç sınıflandırma modelleri için MLOps işlem hattımız aşağıdadır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w8TDzhHJLqw2WmR3Uzz1Iw.png" /></figure><p><strong>Teknik Gözlemler:</strong> Hugging Face transformers kullanmak hem davinci’yle few-shot prompting karşılaştırmasında hem de diğer tekniklere karşı yüzde 10–15 civarı doğruluk oranı artışı verdi. transformers’ın başka iyi bir tarafıysa model açık kaynak olduğu için inference API kullanıldığında bir sorun çıkması dahilinde modelin elimizin altında olması ve hızlıca üretime çıkarabilmemizdi. BERT fine-tuning’inde sadece sınıflandırıcı katmanı eğittiğimizden ötürü her eğitim Colab’deki GPU’da yaklaşık 3–4 dakika sürdü, sonrasında modelleri Hugging Face Hub’a attık. Modelin Hub’da olması inference API’nin çalışması için yeterliydi, bu yüzden modeli API haline getirmek için ekstra bir efor sarfetmedik.</p><p><strong>Not:</strong> Bu uygulamaların arkasında bunları kısa sürede çıkarmak için gece gündüz çalışan onlarca kişi var.</p><h3>Uzaktan Algılama Uygulamaları</h3><p>Uzaktan algılama tarafında çalışan takımlar arama kurtarma operasyonlarını yönlendirmek amacıyla binalara ve altyapıya verilen hasarı değerlendirmek için uzaktan algılama uygulamaları üzerinde çalıştı. Depremin ilk 48 saatinde elektriğin ve sabit mobil ağların olmaması, çöken yollarla birleştiğinde, hasarın boyutunun ve nerede yardıma ihtiyaç duyulduğunun değerlendirilmesini son derece zorlaştırdı. Arama kurtarma operasyonları, iletişim ve ulaşımdaki zorluklar nedeniyle yıkılan ve hasar gören binaların yanlış ihbarlarından da büyük ölçüde etkilendi. Bu sorunları ele alma ve gelecekte kullanılabilecek açık kaynak araçları oluşturma çabasıyla, Planet Labs, Maxar ve Copernicus Open Access Hub’dan etkilenen bölgelerin deprem öncesi ve sonrası uydu görüntülerini toplayarak başladık.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*StM0x6IFAMr7Bk3AOatkfw.png" /></figure><p>İlk yaklaşımımız, “binalar” için tek bir kategoriyle, nesne algılama ve örnek bölümleme için uydu görüntülerini hızlı bir şekilde etiketlemekti. Amaç, aynı bölgeden toplanan deprem öncesi ve sonrası görüntülerde ayakta kalan bina sayılarını karşılaştırarak hasarın boyutunu değerlendirmekti. Modelleri eğitmeyi kolaylaştırmak için 1080x1080 uydu görüntülerini daha küçük 640x640 parçalara kırparak başladık. Ardından, bina tespiti ve bir <a href="https://huggingface.co/spaces/deprem-ml/deprem_satellite_test">YOLOv5</a>, YOLOv8 ve EfficientNet modellerinde tespit için ince ayar yaptık. Anlamsal segmentasyon içinse <a href="https://huggingface.co/spaces/deprem-ml/deprem_satellite_test">SegFormer</a> fine-tune ettik ve bu uygulamaları Hugging Face Spaces uygulaması olarak dışarıya açtık.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5Q0iY1WGKtFHNIfuI68Alw.png" /></figure><p>Yine, onlarca kişi etiketleme, veri hazırlama ve eğitim modelleri üzerinde çalıştı. Bireysel gönüllülere ek olarak, <a href="https://co-one.co/">Co-One</a> gibi şirketler, uydu verilerini, binalar ve altyapı için <em>hasar yok</em>,<em> yıkıldı</em>, <em>hasarlı</em>, <em>hasarsız tesis</em> gibi daha ayrıntılı açıklamalarla etiketlemek için gönüllü oldu. An itibariyle nihai hedefimiz, gelecekte dünya çapındaki arama ve kurtarma operasyonlarını hızlandırabilecek kapsamlı bir açık kaynak veri seti yayınlamaktır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cYZHjkY36L1EK5BtANFubg.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dbbe10d7f736" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Complete Guide on Deep Learning Architectures, Chapter 1 on ConvNets]]></title>
            <link>https://merveenoyan.medium.com/complete-guide-on-deep-learning-architectures-chapter-1-on-convnets-1d3e8086978d?source=rss-763008f53ee9------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d3e8086978d</guid>
            <dc:creator><![CDATA[Merve Noyan]]></dc:creator>
            <pubDate>Sat, 19 Nov 2022 16:05:39 GMT</pubDate>
            <atom:updated>2022-11-19T16:05:39.954Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eF561ZR8Jq5nAlDYVhTtbQ@2x.jpeg" /></figure><p>Welcome to my guide where I compiled my intuitions, notes and code on deep learning architectures. As a pre-requisite, you only have to know about basics of deep learning: forward pass, backward pass, activations and so on.</p><p>My motivation to write this comes from most of the people finding the theory overwhelming and fail to implement the algorithms (I was one of them!). Before every midterm &amp; final I always made sure I understand intuition enough to solve any problem, I studied from wide range of resources to not get overfitted into one’s intuition, tried to put down everything. I hope this guide will be useful to people who take technical interviews or exams or simply is willing to understand.</p><h3>Convolutional Neural Networks</h3><h4>Convolution: Basic Ideas</h4><p>Convolution is an operation used to extract features from data. This can be 1D, 2D or 3D. I’ll explain the operation with a solid example, all you need to know now is that the operation is simply takes a matrix made of numbers, moves it through the data, takes the sum of products between the data and that matrix. This matrix is called <strong>kernel</strong> or <strong>filter</strong>. You might say, “what does it have to do with the feature extraction and how am I supposed to apply it?”.</p><p>Don’t panic! We’re getting to it.</p><p>To illustrate the intuition, I’d like us to take a look at this example. We have this 1D data and we visualize it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9m7kGmT735a1mOm0T9i_Tw.png" /></figure><p>I have this kernel [-1, 1]. I’ll start from left-most element, put the kernel, multiply the overlapping numbers and sum them up. Kernels have something <strong>centers</strong>, it’s one of the elements. Here, we pick the center as 1 (the element on the right). Now, the kernel’s center has to touch every single element, so we put a zero to the the left of the element for convenience. If I don’t pad it, I’ll have to start multiplying -1 with the left-most element, and 1 will not touch the left-most element, that’s why we apply padding. Let’s see how it looks like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9pzDGmiacsu1rB000KOSdA.png" /></figure><p>I’m multiplying the left-most element (that is currently a pad) with -1, the first element (zero) with 1 and sum them up, get a 0 and note it down. Now, I’ll move kernel by one position and do the same, note it down again, this movement is called <strong>striding</strong>, this is usually done by moving the kernel by one pixel, you can also move it with more pixels. The result (convolved data) is currently an array [0, 0].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aEkuM4Lc8XyA2Dxjjebb7w.png" /></figure><p>I will repeat it until the right element of kernel touches every element, which yields the below result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4U76oLjqj6A0mbx-TU_TBg.jpeg" /></figure><p>Notice anything? The filter gives changes in the data (the derivatives!), this is one characteristic we could extract from our data. Let’s visualize.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_66ziCIFvasmqasdh6LZSQ.jpeg" /></figure><p>The convolved data (result of the convolution) is actually called <strong>feature map</strong> and it makes so much sense, as it shows, well, the features we can extract, the characteristics related to data, the change.</p><p>This is exactly the deal with edge detection filters as well! Let’s see it in 2-dimensional data. This time, our kernel will be different, it will be a 3x3 kernel (could’ve been 2x2 as well, just saying).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*buqx-5MFVuTi3FZM0uktLA.jpeg" /></figure><p>This filter is actually quite famous but I won’t spoil it for you now :). Previous filter was [-1 1] meanwhile this one is [-1 0 1], it’s just 3x3 and nothing different, it gives changes on the horizontal axis as well. Let’s see an example and apply convolution. Below is our 2D data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/1*23jTPwz-bFQ_Nu-XqI1YhQ.jpeg" /></figure><p>Think of this as an image and we want to extract the horizontal changes. Now, the center of the filter has to touch every single pixel, so we pad the image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T9xmjiacVx7MCTDg1alidw.jpeg" /></figure><p>The feature map will be the same size as the original data. The result of the convolution will be written to the same position that the center of the kernel touched in the original matrix, meaning, for this one, it will touch the left-most and the top position.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fdiWG3HUYbKVrczh2IgxHA.jpeg" /></figure><p>If we keep applying the convolution we get following feature map.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*g-hqpwugZv8y8AVhf7F-kQ.jpeg" /></figure><p>Which shows us the horizontal change, the edges. This filter is actually called the <strong>Prewitt Filter</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*tFG-KxBSw4cApgYxM1bdxQ.jpeg" /></figure><p>You can flip the Prewitt filter to get the changes in vertical direction. Sobel filter is another filter for edge detection.</p><h4>Convolutional Neural Networks</h4><p>Fine, but what does it have to do with deep learning? Well, brute forcing filters to extract features does not work well with every image. We could somehow find the optimal filters used to extract important information, or even detect objects in the images. That’s where convolutional neural networks come into play. We convolve images with various filters, and these pixels in the feature maps will eventually become our parameters that we will optimize, and in the end, we will find the best filters for our problem.</p><p>The idea is, we will use filters to extract information. We will randomly initialize multiple filters, create our feature maps, feed it to a classifier and do back propagation. Before diving into it, I’d like to introduce you to something we call “pooling”.</p><p>As you can see above, there are many pixels that show the change in the feature map. To know that there’s an edge, we actually need to see that there’s one change and that’s it. We can actually get the information that there’s a change (an edge, a corner, anything). In the above example, we could’ve gotten only one of the 2’s, and that would be enough. This way, we will store less parameters and still have the features. This operation of getting the most important element in the feature map is called <strong>pooling</strong>. With pooling, we lose the exact location of a pixel where there’s an edge, but end up storing less parameters. Also, this way, our feature extraction mechanism will be more robust to small changes, e.g. we only need to know that there are two eyes, a nose and a mouth to know that there’s a face in an image, the distance between those elements and the size of those elements tend to change from face to face, and pooling enables the model to be more robust against these changes. Another good thing about pooling is that it helps us handle varying input sizes. I’d like you to watch <a href="https://www.youtube.com/watch?v=f1fXCRtSUWU">this video</a> to gather a better intuition. Below is the max pooling operation, where every four pixels, we get the maximum pixel. There are various types of pooling, e.g. average pooling, weighted pooling or L2 pooling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oZQ6lILAx5FuGxnqmX3Z2g.jpeg" /></figure><p>Let’s get to the architecture. We will use a Keras example and I will walk you through what’s happening. Below is our model (again, don’t panic, I will walk you through what’s happening).</p><p>If you don’t know what <a href="https://medium.com/analytics-vidhya/keras-model-sequential-api-vs-functional-api-fc1439a6fb10">Keras Sequential API</a> is doing, it stacks layers like lego bricks and connects them. Each layer has different hyperparameters, Conv2D layer takes number of convolution filters, kernel size and activation function, while MaxPooling2D takes pooling size, and dense layer takes number of output units (again, don’t panic).</p><p>Most of the convnet implementations don’t do padding for the sake of letting kernel touch every pixel in an image processing fashion, since padding with zeroes come with an assumption that we might have features in borders, and it adds a complexity for calculation on top. That’s why you’re seeing that the first input size is (26,26), we lose information along the borders.</p><pre>model = keras.Sequential(<br>    [<br>        keras.Input(shape=input_shape),<br>        layers.Conv2D(32, kernel_size=(3, 3), activation=&quot;relu&quot;),<br>        layers.MaxPooling2D(pool_size=(2, 2)),<br>        layers.Conv2D(64, kernel_size=(3, 3), activation=&quot;relu&quot;),<br>        layers.MaxPooling2D(pool_size=(2, 2)),<br>        layers.Flatten(),<br>        layers.Dropout(0.5),<br>        layers.Dense(num_classes, activation=&quot;softmax&quot;),<br>    ]<br>)</pre><pre>model.summary()</pre><pre>Model: &quot;sequential&quot;<br>_________________________________________________________________<br>Layer (type)                 Output Shape              Param #   <br>=================================================================<br>conv2d (Conv2D)              (None, 26, 26, 32)        320       <br>_________________________________________________________________<br>max_pooling2d (MaxPooling2D) (None, 13, 13, 32)        0         <br>_________________________________________________________________<br>conv2d_1 (Conv2D)            (None, 11, 11, 64)        18496     <br>_________________________________________________________________<br>max_pooling2d_1 (MaxPooling2 (None, 5, 5, 64)          0         <br>_________________________________________________________________<br>flatten (Flatten)            (None, 1600)              0         <br>_________________________________________________________________<br>dropout (Dropout)            (None, 1600)              0         <br>_________________________________________________________________<br>dense (Dense)                (None, 10)                16010     <br>=================================================================<br>Total params: 34,826<br>Trainable params: 34,826<br>Non-trainable params: 0<br>_________________________________________________________________</pre><p>Convolutional neural networks start with an input layer and a convolutional layer. Keras Conv2D layers take number of kernels and the size of the kernel as parameters. What’s happening is illustrated below. Here, we convolve the image with 32 kernels and end up with 32 feature maps, each having the size of the image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3A_0WappULYAjY2DOUV8Qg.jpeg" /></figure><p>After convolutional layers, we put a max pooling layer to reduce the number of parameters stored and make the model robust to the changes, as discussed above. This will reduce the number of parameters calculated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I-ZsUdDiU7zOqDgPmL7D4w.jpeg" /></figure><p>Then, these feature maps are concatenated together and are flattened.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*5SbA0Tl4iCgNiVhf_Wwg4A@2x.jpeg" /></figure><p>Later on, we use something called dropout to drop a portion of parameters to avoid overfitting. Finally, the final form of weights will go through dense layer for the classification part to finally get classified and backpropagation will take place.</p><h3>Backpropagation in Convolutional Neural Networks in Theory</h3><p>How does the backpropagation work here? We want to optimize for the best kernel values here so they’re our weights. At the end, we expect the classifier to figure out relationship between pixel values, kernels, and classes: we have a very long flattened array consisting of elements that consist of pooled and activated version of pixels convolved with initial weights (kernel elements), and we update those weights such that we answer the question “which kernels should I apply to make a distinction between cat and a dog photo?”. So point of training CNNs is to come up with the optimal kernels, and these are found thanks to backpropagation. Prior to CNNs, people would try to try a lot of filters on an image to extract features themselves, meanwhile most generic filters (like we’ve seen above, e.g. Prewitt or Sobel) do not necessarily need to work for all images given images can be very different, even in the same dataset. This is why CNNs outperform traditional image processing techniques.</p><p>There are couple of advantages by means of storage when we use convolutional neural networks.</p><h4>Parameter sharing</h4><p>In convolutional neural networks, we convolve with the same filter across all pixels and all images which provides an advantage over storing parameters, this is much more efficient than going through an image with a dense neural network. This is called “weight tying” and those weights are called “tied weights”. This is also seen in autoencoders.</p><h4>Sparse Interactions</h4><p>In densely connected neural networks, we input the whole piece of data at once -which is very overwhelming due to how images have hundreds or thousands of pixels-, meanwhile in convnets, we have smaller kernels that we use to extract features. This is called sparse interaction, and it helps us use less memory.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d3e8086978d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Open-Source Contributio: How to Get Started]]></title>
            <link>https://merveenoyan.medium.com/open-source-contributio-how-to-get-started-9c149fde5a6?source=rss-763008f53ee9------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c149fde5a6</guid>
            <dc:creator><![CDATA[Merve Noyan]]></dc:creator>
            <pubDate>Mon, 18 Jul 2022 18:52:21 GMT</pubDate>
            <atom:updated>2022-08-04T16:22:14.580Z</atom:updated>
            <content:encoded><![CDATA[<h3>Open-Source: How to Get Started</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WlYzRiBmnwcE9zM25lhMmw.jpeg" /><figcaption>Drawing of Comet Morehouse, 1908 (<strong>C/1908 R1</strong>)</figcaption></figure><p>This article is for people who’d like to get started with contributing to open-source with code, or community contributions, or writing their own libraries from scratch. Note that this article is quite opinionated, as my experience is limited.</p><h3>How I Started my Journey</h3><p>I came across <a href="https://www.youtube.com/watch?v=G5lmya6eKtc">this video</a> by Hugging Face on YouTube that changed my life. I started following Thomas Wolf (the person on the video, who’s Chief Scientist at Hugging Face) on twitter, and must say I was such a big fan of what Hugging Face was doing. One day I saw him posting about a contribution sprint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*31uJNlmY1iaQZlzlovfpcg.png" /></figure><p>I got myself signed up without knowing about any open-source workflows. We were supposed to commit a dataset script that would load the dataset and create splits and define configurations and various specifications of the dataset.</p><p>I must be honest I struggled quite a lot in the first place. I didn’t even know about formatting, let alone CI!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*QYprXKdcR5HG6hqhQnJU0w.png" /></figure><p>I required guidance, but after a while I started helping people out though, thanks to Quentin and Yacine teaching me about the workflows 🤩 Also they usually write down contribution guides which helps you a lot if you follow them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*86IrNfpjwhhvC9Dndek20w.png" /><figcaption>hehe</figcaption></figure><p>After that, I participated in other sprints (like wav2vec one), where I failed — due to quality of data, the model wasn’t performing well and I didn’t have time to find other sources of data without breaching licenses or doing something against PII. After a while, I started teaching people about how to use Hugging Face Transformers, I even included it on my talk at Google I/O.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4hqHNdbkiguievCY" /></figure><p>This is another way of contributing to open-source. <strong>You don’t necessarily need to contribute code to contribute to open-source, there are other ways:</strong></p><ul><li>writing documentation (blog posts, library documentation, projects on github)</li><li>gathering people and giving workshops to teach them about a specific open-source tool</li><li>opening issues/feature requests on GitHub and giving feedback, testing beta versions</li><li>answering questions on forum, stackoverflow or developer discord</li></ul><p>are more valuable than you think. A library with no adoption due to lack of documentation or resources is just a code. Codebases require community to thrive.</p><h3>Get Started with Community Contributions</h3><ul><li>Just pick a new tool in the ecosystem, test it and see if it doesn’t work, if it’s not intuitive by means of developer experience and give feedback. Even if you don’t find a bug, pointing out if usage can be simplified is a valuable thing to report.</li><li>Writing a blog post about how to use the tool, putting up a notebook on kaggle or a GitHub repository including a potential use case for the tool is a good place to start.</li><li>If you’re good on shooting videos, you can shoot a video of a walkthrough in ecosystem, developing an application using the tool and more!</li><li>If you’d like to give a talk in a developer conference, putting up a deck on the ecosystem, new things included in latest release or going through an end-to-end application is very good. At Google I/O, I was going through a concept called transfer learning and how to train a model with transfer learning using google’s stack and also Hugging Face.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*JbxKqFQCmE0GzBnNk1GToQ.png" /><figcaption>small part of my graph 🙂</figcaption></figure><h3>Getting Started with Code Contributions</h3><p>It might be quite intimidating and overwhelming to get started to contribute a big codebase: the fear of your PR being rejected, receiving a lot of reviews thinking it’s a bad thing, tests not passing and more. Here’s couple of things no one will tell you but are obvious:</p><ul><li>No one starts contributing to open-source at the age of 1. Everyone has learnt it from someone else.</li><li>As open-source maintainers, we love to onboard new contributors, we’re more than happy to provide guidance.</li><li>Your PR being rejected is not the end of the world, it doesn’t mean your code is bad, there are multiple reasons of it (that I’ll go through) and you should open a second PR.</li></ul><p><strong>🌈 Open an issue before opening a PR or find the issue that you want to solve and discuss with developers first 🌈</strong></p><p>There are design decisions associated with each codebase. If you came across a design that you don’t agree on or you saw a problem, first find the issue if it exists or open one and discuss with developers. Come up with an initial design of a solution and then open a PR that you can iterate on.</p><p>🌈 <strong>Find good first issues </strong>🌈</p><p>Most of the libraries have issue tags under <a href="https://github.com/scikit-learn/scikit-learn/labels">https://github.com/organization/library-name/labels</a>. You need to filter for issues that have good first issue tags, they are usually good to get started with a codebase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MvqF4GhtjBv9qQhHnQVxaA.png" /></figure><p>These do not guarantee your PR will be merged but they will ease the process and make it more likely for your PRs to be merged.</p><p>✨ <strong>Try to follow the developer communities</strong> ✨</p><p>As I told my story, my journey has become with me following Hugging Face. Like Hugging Face, many developer communities have open-source contribution sprints, like scikit-learn. You need to keep in touch with the core developers to be notified about the sprints and more. The good thing about sprints is that the core developers dedicate a large portion of their time to help you out, thus make it easier for you to get started. At Hugging Face, we have good amount of sprints, including:</p><ul><li>We’ve done a documentation sprint: where transformers library needed to update the docstrings of the functions and with the help of community, we documented the codebase.</li><li>wav2vec/2 sprints: Where everyone trains an audio model with their own language. Given number of languages are overwhelming for core developers to handle, we provided compute, scripts and guidance to participants to train a model and commit.</li></ul><p>🙌🏻 <strong>Some tools you can get familiar with that open-source libraries use:</strong></p><ul><li><a href="https://pre-commit.com/">pre-commit</a>: Some libraries use pre-commit hooks. Once installed, it formats your code during committing your code.</li><li>black/flake-8/isort/any formatting or quality tool: Every code base has a style guide that it follows. For python, black helps format the code automatically, meanwhile flake8 checks the code for quality, e.g. you might have a variable you’ve defined but not used. For other languages, you need to find out what works.</li><li>test libraries: If you’re contributing to an open-source library with a new addition to the codebase, you need to be familiar with testing as you’ll be expected to write a test for your code to preserve code coverage.</li></ul><h3>Getting started with writing your own library</h3><p>I recently started writing a library from scratch with my colleagues. Before that, I tried writing another library with one of my friends and horribly failed. The main reason was that I couldn’t come up with a design for the functions, classes &amp; co. I got overwhelmed and couldn’t put my ideas into library. This time I was lucky enough to work with a <a href="https://twitter.com/adrinjalali">very experienced open-source developer</a> (follow him!). Couple of things I learnt from him that has given me a starting point:</p><ul><li>Always put developer experience before anything. A codebase that is not intuitive will not be adopted.</li><li>This way, he gave me a good starting point: before anything, he’s writing executable notebook-like code cells and define how users will interact, before actually writing the code itself, then he implements the code afterwards. (Check <a href="https://github.com/skops-dev/skops/commit/59790276ceb09970c0afcbbca4385f2c0537157f#diff-23fb8ed00cd8ac4f126f603b95e320475aade82860fe6fe948cd8841d6292e5b">here</a>)</li><li>Related: document your code well, e.g. write docstrings first and then implement.</li><li>Write tests. Writing tests might be cumbersome but it will make sure your code will always work as intended and be robust against edge cases, and will prevent problems related to consistency next time someone contributes a code, help with backwards compatibility.</li><li>For later, put up contribution guidelines to onboard new developers. Try to define rules about merger, styling and so on such that it will easily scale to multiple maintainers or contributors, e.g. we don’t merge our own code ourselves for sanity check.</li></ul><p>Finishing up the blog, I have couple of thanks to make to people who onboarded me to open-source and convinced me to do it for full-time (give them a follow if you want to learn more about contributing 🙂)</p><ul><li><a href="https://twitter.com/YJernite">Yacine</a> &amp; <a href="https://twitter.com/qlhoest">Quentin</a> for helping me out on my first sprint</li><li><a href="https://twitter.com/osanseviero">Omar</a> &amp; <a href="https://twitter.com/julien_c">Julien</a> for reaching out to me to let me work with them</li><li><a href="https://twitter.com/adrinjalali">Adrin</a> for teaching me a new thing every single day.</li></ul><p>(and more people from Hugging Face that I wouldn’t be able to fit their names in this blog)</p><p>If you have any additions or stories to add, this article is open to additions, I will add your stories below this article, so feel free to reach out to me on <a href="https://twitter.com/mervenoyann">my twitter</a>, I’d love to hear your open-source stories.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*5K0z3hv1YhVSXEuG.gif" /><figcaption>Copyrighted by Looney Tunes (public domain)</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c149fde5a6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Putting Keras on  Hub for Collaborative Training and Reproducibility]]></title>
            <link>https://merveenoyan.medium.com/putting-keras-on-hub-for-collaborative-training-and-reproducibility-9018301de877?source=rss-763008f53ee9------2</link>
            <guid isPermaLink="false">https://medium.com/p/9018301de877</guid>
            <dc:creator><![CDATA[Merve Noyan]]></dc:creator>
            <pubDate>Fri, 22 Apr 2022 13:26:00 GMT</pubDate>
            <atom:updated>2022-05-16T11:15:20.677Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c3exo5p3_R7GrWBBobS6Cg.png" /></figure><p>Reproducibility, experiment tracking and collaborative training are couple of problems in open-source machine learning. At Hugging Face, we are challenging these issues to enable collaborative training, versioning models and hosting open-source machine learning demos on Hugging Face Hub. Thanks to recent Keras integration, you can easily:</p><ul><li>Push and save a model to Hugging Face Hub and let others pull easily,</li><li>Version your models,</li><li>Reproduce your experiments with automatically generated model card and hosted TensorBoard instance,</li><li>Load model with only one line of code,</li><li>Easily load your models for demonstration on Spaces.</li></ul><h3>Pushing Your Model to the Hugging Face Hub</h3><p>After your training is done, you can call push_to_hub_keras() to push your model to Hugging Face Hub.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e6c2dfcd92007fbec8244252f27b1f22/href">https://medium.com/media/e6c2dfcd92007fbec8244252f27b1f22/href</a></iframe><p>which will generate a model card that includes your model’s hyperparameters, metrics of your model in a JSON, plot of your model and couple of sections related to the usage purpose of your model, biases the training data might have and limitations about putting your model to production. The tags are written to model card and are used for others to find your models easily. The repository will host your tensorboard traces like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z-W2sAKWsLjK_FlZLaX4mA.png" /><figcaption>Your tensorboard traces will look like this 🙌🏻</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hyYISzHuFc3MrWn0gNH_BQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*_hBAw1O1lYvhzd7Cr7dijQ.png" /><figcaption>Your model history, hyperparameters and plot are included in the card 🃏</figcaption></figure><p>You can see the example hosted model with model card and tensorboard traces <a href="https://huggingface.co/merve/model-card-example/tensorboard">here</a>.</p><p>Your model is saved with tf.keras.models.save_model(). You can pass the rest of the arguments in **model_save_kwargs. This saves your model as SavedModel with weights and graph, which is a format that you can later convert to other model formats in TensorFlow Extended to later use your model in browsers, edge devices, REST/gRPC APIs.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1269df0ee40cb0e52154bd2035224fcd/href">https://medium.com/media/1269df0ee40cb0e52154bd2035224fcd/href</a></iframe><h3>Loading Your Model and Building A Demo</h3><p>After your model is pushed, you can simply load your model with from_pretrained_keras(). You can also load a Keras model that you’ve liked on the Hub like below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/435fd8a8067ce2c0e6e9c51edc489329/href">https://medium.com/media/435fd8a8067ce2c0e6e9c51edc489329/href</a></iframe><p>To demonstrate your model’s capabilities, you can simply load your model with from_pretrained_keras(), write an inference function in an app.py file, then create a Spaces repository and drag and drop your app.py file and your application will be ready.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-ZVNcE9UaAGaYWQgqNSUlA.gif" /><figcaption>You can simply drag and drop your app.py file and your Space will be built! ✨</figcaption></figure><p>We’ve organized a sprint to train the Keras examples, host them on Hugging Face Hub and build interactive demos for reproducibility. If you liked a Keras example, simply look at the bottom of the example and you can find redirections to model and Space repositories.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3luzDsDhsK8_dzQQrVZYoA.png" /><figcaption>Find the awesome tutorial here: <a href="https://keras.io/examples/vision/probing_vits/">https://keras.io/examples/vision/probing_vits/</a></figcaption></figure><p>The Keras examples are all hosted in this <a href="https://huggingface.co/keras-io">page</a>, see the model repositories and Spaces applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7fc6_PXNdIYzMNwrQp1lsg.png" /><figcaption>Where was this model during Game of Thrones! 🥲</figcaption></figure><p>We’ve written two guides to build <a href="https://huggingface.co/blog/streamlit-spaces">Streamlit</a> and <a href="https://huggingface.co/blog/gradio-spaces">Gradio</a> demos easily host them on the Hugging Face Hub.</p><p>Thanks a lot for reading. 🤗. I’d love to hear your experience and feature requests for Keras at merve@hf.co. We’re planning a second round of the Keras sprint (and more community events!), if you’d like to be informed, feel free to join to our <a href="https://huggingface.co/join/discord">Discord channel</a> 👾.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9018301de877" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bir Veri Bilimcinin Araç Çantası]]></title>
            <link>https://merveenoyan.medium.com/bir-veri-bilimcinin-ara%C3%A7-%C3%A7antas%C4%B1-ca51fb5cd19e?source=rss-763008f53ee9------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca51fb5cd19e</guid>
            <dc:creator><![CDATA[Merve Noyan]]></dc:creator>
            <pubDate>Fri, 15 Oct 2021 08:00:01 GMT</pubDate>
            <atom:updated>2021-10-15T09:39:05.445Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bXYUPJ2C839x7h0IcIFgmw.jpeg" /><figcaption>Görsel: The New Yorker, <a href="https://paidpost.newyorker.com/article/hbo/rise-ethical-machines">https://paidpost.newyorker.com/article/hbo/rise-ethical-machines</a></figcaption></figure><p>Merhabalar, bu blog yazımda kendimce kaggle yarışmaları ve şirketlerde gördüğüm veri bilimcilerin kullandığı ve benim de çok sevdiğim araçları derledim. Bu yazı fazlasıyla önyargılı (opinionated) bir yazı, bunu belirtmekte fayda var. Bunlar dışında olmasını düşündüğünüz araçlar varsa yazabilirsiniz.</p><p>Ben bu yazıda sklearn, fast.ai, TensorFlow ve PyTorch’u dışarıda bıraktım, bunlar zaten bilmeniz gereken kütüphaneler. Aynı şekilde hangi alanda çalışıyorsanız o alanın kendine has araçları var, bunlardan da bahsetmeyeceğim. (bilgisayarlı görü için opencv, NLP için spaCy, NLTK gibi)</p><p>Genel hatlarıyla ele alacak olursak sizi bir adım öteye taşıyacak araçlar ise,</p><ul><li>MLOps platformları (W&amp;B, Comet ve diğerleri)</li><li>Öneğitimli modeller barındıran çözümler (Hugging Face, AllenNLP, Stanza, Tensorflow Hub)</li><li>Veri bilimi ve makine öğrenmesi projelerinize kolayca arayüz yapmanızı sağlayan kütüphaneler (Streamlit, Gradio)</li><li>Size iyi bir baz çözüm veren AutoML araçları (H2O, AutoNLP)</li></ul><p>Bunların hepsini az sonra detaylandıracağım.</p><p>Bu <a href="https://merveenoyan.medium.com/python-geliştirirken-en-çok-kullandığım-araçlar-a14602dbf7fb">yazımda</a> son bir senedir makine öğrenmesi mühendisi olarak çalıştığım yerde backend geliştirirken kullandığım postman, ngrok, gazpacho gibi araçlardan ve katıldığım açık kaynak sprint’lerde öğrendiğim flake8, black gibi kütüphanelerden de bahsettim, ilginizi çekebilir. Bunların hepsi hakkında video çekmeye başladım, yakında koymayı planlıyorum.</p><p>Hazırsak başlayalım.</p><h3>MLOps Platformları</h3><p>MLOps, DevOps’un kod odaklı değil model odaklı yönetim biçimi. MLOps’ta kodun versiyon kontrolünden ziyade deney takibi (experiment tracking) var. Hangi modeliniz, hangi hiperparametrelerle nasıl sonuç verdi bunlara bakıyorsunuz aslında. Makine öğrenmesinin baştan sona kendine has dertleri var, başka bir tanesi ise veri kayması (data drift), bunu da üretim sonrasında modeli izleyen bir araçla halletmeniz gerek, bu platformlar bu çözümü de sağlıyor. Bunlardan en çok bilinen iki tanesi <a href="https://wandb.ai/site">Weights &amp; Biases</a> ve <a href="https://www.comet.ml/site/">Comet</a>. Bu araçlar çok büyük veri bilimi takımları tarafından an itibariyle kullanılıyor. Bu <a href="https://www.reddit.com/r/MachineLearning/comments/p43g70/p_mlops_monitoringcompanies_marketcomparison/?utm_source=share&amp;utm_medium=ios_app&amp;utm_name=iossmf">linkte</a> bu platformların karşılaştırmasına bakabilirsiniz (içinde MLFlow, KubeFlow, neptune.ai gibi diğer platformlar da var). Benim gözlemim Comet uçtan uca daha fazla süreci kendi içinde barındırıyor, W&amp;B kaggle topluluklarında çokça kullanılıyor (belki UX farklılıklarından). Bunlar kişisel projeler için ücretsiz, bu yüzden kaggle yarışmalarında çok kullanılıyor, Google, OpenAI gibi şirketlerden para kazanıyorlar.</p><h3>Öneğitimli Modeller Barındıran Platformlar</h3><p>Makine öğrenmesi en son haliyle artık öneğitimli modellerin yaygın şekilde kullandığı bir paradigmaya kaydı. Öneğitimli modellerin hassas ayar çekilmesi, sıfırdan eğitime göre daha iyi performans sergiliyor. Bunun için <a href="https://huggingface.co">Hugging Face</a>, <a href="https://allennlp.org">AllenNLP</a>, <a href="https://www.tensorflow.org/hub">TensorFlow Hub</a> gibi platformları/kütüphaneleri iyi kullanmanız gerek. HuggingFace kendi içerisinde AllenNLP entegrasyonu yaptı, aynı zamanda facebook, google gibi şirketlerin veri bilimi takımları da modellerini Hugging Face’te <a href="http://hf.co/organizations">barındırıyor</a>. Bu platformlardan seçtiğiniz modeli alıp direkt kendi ağırlıklarıyla kullanabilir, ya da kendi veriniz üstünde hassas ayar yapabilirsiniz. Bu platformlarda veri setleri ve önişleme araçları da bulunuyor. Hugging Face ve TF Hub’da NLP’nin yanında ses modelleri/veri setleri ve görüntü modelleri/veri setleri de var. Eğer ses için özelleşmiş bir platform isterseniz <a href="https://coqui.ai">Coqui’ye</a> biz göz atmanızı öneririm.</p><h3>Demo için Arayüz Oluşturma Kütüphaneleri</h3><p>Veri bilimci ya da makine öğrenmesi mühendisiyseniz müşterilerinize ya da projedeki paydaşlarınıza model, keşifsel veri analizi, verisetleriniz gibi normalde notebook’larda dağınık şekilde gösterilen çalışmalarınıza arayüz yapmanız gerek, bu da eğer çok iyi bir önyüz geliştiricisi değilseniz zor bir iş. Burada imdadımıza streamlit ve gradio gibi kütüphaneler yetişiyor. Bunlar modellerinizle tahminde bulunmak için hiperparametreleri alan bileşenlerin yanısıra interaktif veri görselleştirme paketleri, çalıştığınız alan odaklı paketler (spacy-streamlit gibi) de barındırıyor. İkisini de kullanmış biri olarak görüşüm şu şekilde: eğer hızlıca makine öğrenmesi modelinizi demo haline getirmek isterseniz Gradio kullanın. Gradio daha çok model odaklı olmakla birlikte modeller için farklı çeşitlerde input’lar da alıyor (en son çizim için whiteboard bile getirmişlerdi). Streamlit’te ise streamlit’in çekirdek kütüphanesi dışında ekstra bir bileşen isterseniz bunları indirmeniz gerek. Aşağıda çok sevdiğim GPT-2 ile metin yazma uygulamasını streamlit’le yeniden oluşturdum.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ci1yIl3Q-FR7K9ydmAFSoA@2x.jpeg" /></figure><p>Aşağıda keşifsel veri analizimi streamlit’le arayüze çevirdim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*guqw-3tf_vMKE26PfGmkUQ@2x.jpeg" /></figure><p>Gradio’da bir modeli alıp arayüz oluşturup paylaşılabilir hale getirmek iste 5 satırlık kod, üç dakika sürüyor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*CQDXqaEzk9-v9QOF5SmwXA@2x.jpeg" /></figure><p>Bunları nasıl yapabileceğinizi şurada <a href="https://huggingface.co/blog/streamlit-spaces">Streamlit</a> ve <a href="https://huggingface.co/blog/gradio-spaces">Gradio</a> için ayrı ayrı blog’larda ele aldım, bunların kodları da blog’larda mevcut.</p><h3>AutoML Araçları</h3><p>AutoML çoğu zaman sihirli bir çözüm gibi algılansa da aslında makine öğrenmesi mühendisinin takım çantasında olması gereken araçlardan biri. Bu araçlar üzerine iyileştirme yapabileceğiniz temel bir çözüm sağlıyor aslında. İki tane AutoML mühendisiyle podcast yaptım, AutoML neler yapabilir neler yapamaz kendilerine sordum, aşağı yukarı aynı cevaplar aldım. Bu platformların çoğu şirketler için ücretli çözümler olarak veriliyor çünkü modellerinizi eğitip içinde hiperparametre optimizasyonu yapıyorlar, bu da çok uzun GPU saatleri ve yüksek maliyetler demek, bildiğim kadarıyla kişisel kullanım için ücretsiz planları da var. Bunların arkasında yatan arama algoritmalarını yazmak da ustalık gerektiriyor, kişisel görüşüm açık kaynak AutoML araçlarının (TPOT gibi) yeterince iyi çalışmadığı (bu örnekte arkada genetik algoritma çalışıyor, ne yaptığınızı gerçek anlamda bilmiyorsanız kullanmanızı önermem).</p><p>Başka araçlara göz atmak isterseniz <a href="https://www.kaggle.com/kaggle-survey-2021">Kaggle’ın bu sene için yaptığı veri bilimcisi</a> anketine bakabilirsiniz.</p><p>Bu yazıyı bir iki sene sonra güncellenen araçlarla tekrar yazmayı planlıyorum. Okuduğunuz için teşekkür ederim.</p><p>Sorumluluk reddi beyanı: Bu yazı işverenimin (Hugging Face) görüşlerini içermemektedir.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca51fb5cd19e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My reviews on Machine Learning, Data Science and Statistics books]]></title>
            <link>https://merveenoyan.medium.com/my-reviews-on-machine-learning-data-science-and-statistics-books-d1d70924b3d?source=rss-763008f53ee9------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1d70924b3d</guid>
            <dc:creator><![CDATA[Merve Noyan]]></dc:creator>
            <pubDate>Thu, 09 Sep 2021 09:47:41 GMT</pubDate>
            <atom:updated>2021-09-09T09:47:41.608Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bfUCm2jzfV653_2zXdsU4A.jpeg" /></figure><p>I receive questions on content that explains machine learning, statistics or data science on a daily basis. I usually learn from books, so I wanted to write a post about the resources I used, some of them e-books. I’ve finished some of the books, and some of them are in queue. I’ve categorized the books according to topic it covers, and it’s important to note that each book suits you according to your background, e.g. you might be a stats graduate trying to learn machine learning and I might suggest you books on CS or you might be self-taught person that needs to learn the theory. Without further ado, let’s review!</p><h3>Books on Machine Learning/Deep Learning</h3><p><strong>Introducing MLOps: </strong>Although this book is not considered a technical book (there’s no code inside), there is very valuable information on how to manage machine learning processes in production, I think entry-level and junior machine learning engineers can benefit from it.You can get the free PDF of the book here: <a href="https://pages.dataiku.com/oreilly-introducing-mlops">https://pages.dataiku.com/oreilly-introducing-mlops</a></p><p><strong>AI and Machine Learning for Coders (Laurence Moroney): </strong>This book is considered to be more beginner level compared to Geron’s book, explains machine learning to software engineers who want to make an MVP with machine learning models, it’s particularly good for people with software developer background, but if you are advanced it may not work for you.</p><p><strong>Introduction to Machine Learning with Python — Andreas Müller</strong>: I finished this book back when I was trying to learn ML best practices, I call this book “the sklearn book”, it doesn’t cover data science that much, it’s more on machine learning (mostly statistical learning) algorithms, it’s great because it covers best practices on supervised and unsupervised learning. It doesn’t cover the theory that much though, but it’s still a good book for people who aren’t interested that much in the theory of the algorithms and want to train a model. There’s a small chapter on deep learning as well.</p><p><strong>Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow — Aurelien Geron</strong>: I’ve finished this book on TF 1.0, I just bought it for 2.0, it’s one of the best books I’ve read on implementation, it includes both the theory and practice of machine learning and deep learning, but it doesn’t cover the theory as much as the below book (Deep Learning) does. But the good thing is there is the deployment part, it covers ML on the Edge and cloud, and has a section on reinforcement learning with TF-Agents which most tensorflow books don’t cover. It covers all of the tensorflow ecosystem and I refer to this book a lot.</p><p><strong>Deep Learning</strong> — <strong>Bengio, Courville, Goodfellow: </strong>It may be the only book (at least I’ve seen) that delves into the theory of deep learning this deeply. There’s everything from linear algebra to GANs, it gives you the fundamentals and teaches you the advanced part but it doesn’t cover code. I’ve read this, but it’s not an easy to read book (like below one, Deep Learning with Python). There is no practical part, you have to use the book below for this.</p><p><strong>Deep Learning with Python</strong> — <strong>François Chollet</strong>: I finished this book and applied all the codes inside, it covers all of the Keras ecosystem. It may be one of my favorite books as it helped me learn deep learning (I’m a person with operations research background so all I knew was statistical learning algorithms back then). The theory of each algorithm is explained in a simple way and paired with the code.</p><p><strong>Artificial Intelligence A Modern Approach — Peter Norvig &amp; Stuart Russell</strong>: I would call this the “AI book”, I have the third edition, fourth edition might cover machine learning more. It does have a section for machine learning and deep learning but those chapters are really small. This book covers artificial intelligence algorithms, search algorithms, decision making based on AI and reinforcement learning. Also, it was weird to see that it has no dedicated chapter on unsupervised learning. But it’s the best book on AI, I also read the book of Tom Mitchell and this book helps you comprehend everything compared to that book, it’s also relatively easy to read compared to Deep Learning book above.</p><p><strong>Natural Language Processing with Python — Bird, Klein &amp; Loper</strong> : It’s a book that I refer from time to time when I’m trying to solve NLPproblems, as it covers the whole NLTK library, it tells you what your workflow should be depending on the problem, each problem covers a different thing, e.g. segmentation is a problem on it’s own but it’s a pre-requisite for POS tagging and POS tagging is a prerequisite for relationship extraction and it guides you through all of the process. It’s a good starting point if you’re new to natural language processing. It also helps you model a problem which is a great know-how in my opinion.</p><p><strong>Generative Deep Learning, Teaching Machines to Paint, Write, Compose, and Play — David Foster</strong> : This is one of my favorite books for making fun side-projects. It explains how to generate data in various domains(image, sound, text), covers architectures like CycleGAN, VAE, DCGAN, and even language models such as GPT-2 for text generation.</p><h3>Statistics, Data Science</h3><p><strong>Python Data Science Handbook: Essential Tools for Working with Data — Jake VanderPlas</strong>: I enjoyed reading this book a lot and it was one of the books that I started from the beginning and finished completely. There are all the steps to take raw data with pandas and sklearn and manage the process of exploratory data analysis, data preprocessing, model building, hyperparameter optimization. It’s quite comprehensive for end-to-end data science workflow, and I’d highly recommend this book.</p><p><strong>Naked Statistics — Charles Wheelan:</strong> This is one of my favorite books, I wish I came across this while I was studying in the bachelor’s. A very entertaining and intuitive book that explains the core concepts of statistics, it also covers a bit of machine learning. I remember finishing it in two or three days, but it’s not a book you can learn statistics completely, it just gives you intuition.</p><p><strong>The Art of Statistics (How to Learn from Data) — David Spiegelhalter:</strong> This book is very similar to Naked Statistics, but it’s more advanced. The author explains statistics in an entertaining way. Unfortunately, this is not a book where you can learn statistics (it’s not enough to apply statistics, in my opinion), but it does answer most of the statistics-related questions, like why we need it and how can we use it.</p><p>I have this below book if you’d like to study statistics.</p><p><strong>Probability and Statistics for Engineers — Jay L. Devore</strong>: It’s a textbook where you can learn probability and statistics from scratch. I’m usually very skeptical of intuitions (though I like them) so I usually prefer to study and solve problems and I finished this book in one semester, though I passed the class with a BA (that is completely my fault :’)). It’s one of the most comprehensive books I’ve read.</p><h3>Cognitive Science:</h3><p><strong>The Book of Why — Judea Pearl: </strong>This book covers causality, Judea Pearl explains why causality should not be confused with correlation and how you can distinguish between the two. I read some of it but had to take a break because of my exams.</p><p><strong>Thinking, Fast and Slow — Daniel Kahneman: </strong>Daniel Kahneman is one of the two best in the cognitive science field, along with Amos Tversky, and he received the Nobel Prize in economics. This book explains the cognitive biases we have, and people’s behavior when they think fast. I’ve heard of this book from the data science lecturer at the master’s, as he said it’s good to read this to understand people’s behavior when you want to make an inference from the data.</p><h3>Python:</h3><p><strong>Data Structures and Algorithms in Python — Tamassia, Goodrich, Goldwasser</strong>: I’m not a computer science graduate so I sat down and took the data structures and algorithms class, and I met this book. The main reason I took this course is that good companies often interview you for data structures and algorithms, but later on I realized how necessary this is for engineer-like thinking. I have to admit that every time I read it, it changes my perspective on these concepts. It is both a theoretical and a practical book, it contains the theory and application of each algorithm, in Python, which I recommend you to learn DA&amp;A with, as it’s an easy language and algorithms and data structures doesn’t really change from language to language.</p><p><strong>Flask Web Development: Developing Web Applications with Python — Miguel Grinberg</strong>: I loved this book because I had no idea about development. The book covers development as a concept (e.g. databases, requests, bootstraps, security) then walks you through you how can implement it in Flask. I still refer to it from time to time and recommend this book if you want to develop something and you have no idea on development.</p><h3>Manga Guides</h3><p>I loved the manga guides, they keep your attention and explain the concepts visually. I mainly read the one for linear algebra (oh how I wish I read it when I was in bachelor’s), statistics and microprocessors. I will read the ones for databases and cryptography when I make time. I recommend these series to anyone who gets bored during studying.</p><p>I’m currently reading Deep Learning for Coders with fastai &amp; Pytorch by Sylvain Gugger &amp; Jeremy Howard. Will add the review soon.</p><p>Some books in queue:</p><ul><li>Learning Tensorflow.js by Gant Laborde</li><li>Approaching (Almost) Any Machine Learning Problem by Abhishek Thakur</li><li>The Most Human Human by Brian Christian</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1d70924b3d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python geliştirirken en çok kullandığım araçlar]]></title>
            <link>https://merveenoyan.medium.com/python-geli%C5%9Ftirirken-en-%C3%A7ok-kulland%C4%B1%C4%9F%C4%B1m-ara%C3%A7lar-a14602dbf7fb?source=rss-763008f53ee9------2</link>
            <guid isPermaLink="false">https://medium.com/p/a14602dbf7fb</guid>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[yazılım]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[software]]></category>
            <dc:creator><![CDATA[Merve Noyan]]></dc:creator>
            <pubDate>Mon, 23 Aug 2021 17:56:14 GMT</pubDate>
            <atom:updated>2021-08-23T17:56:14.960Z</atom:updated>
            <content:encoded><![CDATA[<p>Merhabalar, daha önce gelen talepler üstüne bu yazımı kaleme alıyorum. İşim gereği python’da backend de geliştirmem gerekiyor ve veri bilimi çıkışlı biri olarak zorlandığım durumlar olsa da hayatımı kolaylaştıran araçlardan bahsedeceğim. Öncelikle sevdiğim python kütüphanelerinden, sonra environment tercihimden ardından da IDE ve text editörü seçimlerimden bahsedeceğim.</p><h3><strong>Kütüphaneler</strong></h3><h3>Flask</h3><p>Flask kütüphaneden ziyade bir Python’la backend geliştirme platformu denebilir. Django’dan daha esnek bulduğum için Flask kullanıyorum. Öğrenirken de Miguel Grinberg’ün <a href="https://www.oreilly.com/library/view/flask-web-development/9781491991725/">“Flask Web Development: Developing Web Applications with Python”</a> kitabını baştan sona okuyup uygulamaya çalışarak öğrendim. Eğer backend hakkında hiçbir fikriniz yoksa bu kitap size baştan güvenlik, logging, database’ler, istekler ve daha fazlası hakkında gereken temel bilgiyi de sağlıyor. Bunların hiçbirinden bu yazıda bahsetmiyorum, bu yazı daha çok yardımcı araçları içeriyor.</p><h3>Postman (ve Responses)</h3><p>Postman geliştirdiğiniz API’ya istekler göndermenizi kolaylaştıran bir araç. Postman’dan önce kendi yazdığım unit test’leri otomatize etmeye çalışarak her güncellemeden önce test yapıyordum, bu arada bunun için ayrı bir kütüphane kullanıyordum, adı da <a href="https://pypi.org/project/responses/">responses</a>. Responses kütüphanesiyle basit şekilde test yazıyorsunuz, içinde requests’le isteğinizi gönderip çıktısını istediğiniz cevabı döndürüyor mu diye assert ettiriyorsunuz, linki koyduğum dokümentasyonda güzel örnekler var. Oturup buna vakit harcamak yerine isteklerimi Postman’in altında bir koleksiyon olarak tutmaya karar verdim, bu işimi fazlasıyla kolaylaştırdı.</p><h3>Pdb</h3><p>Pdb (python debugger) işimi en çok kolaylaştıran araç olabilir. Hata fırlattığınız kodun bir üst satırına import pdb;pdb.set_trace() yazıp kodunuzu terminal’de çalıştırarak pdb’nin bulunduğu yere kadar çalıştırıp, pdb’nin bulunduğu yerde kodunuzu durdurup değişkenlerin o anda aldığı değerlere, istek atılıyorsa cevabına, o an olan herhangi bir şeye bakabiliyorsunuz, ardından kodunuzu n diyerek satır satır çalıştırarak devam ediyorsunuz.</p><h3>Black</h3><p><a href="https://calmcode.io/black/introduction.html">Black</a>’i huggingface’in açık kaynak datasets (kütüphane) etkinliğinde keşfettim. Black’te sadece bir satır komutla kodunuzu formatlıyor, bu da CI/CD için (özellikle açık kaynak projelerde) çok kullanışlı bir şey. Kendi projenize katkı sağlayacak kişiler için kullanabilirsiniz. Her commit’ten önce çalışması için otomatikleştirebiliyorsunuz bu arada.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P--c4J4540ZD37Fp45TdcQ.png" /></figure><h3>flake8</h3><p><a href="https://calmcode.io/flake8/usage.html">flake8</a>&#39;in black’ten farklı sizin hatalarınızı (kodunuzun davranışından ziyade format, kullanılmayan kütüphane ve değişkenler) göstermesi. Daha önce pycodestyle ve pyflakes’i ayrı ayrı kullanmış olanlar için daha kullanışlı çünkü bu ikisinin üstüne yazılmış bir kütüphane.</p><h3>Ngrok</h3><p><a href="https://calmcode.io/ngrok/the-problem.html">Ngrok</a> herhangi bir uygulamayı kendi bilgisayarınızda host ederken başka insanların da buna erişebilmesini sağlayan bir servis. Bunu genelde chatbot için yaptığımız veri etiketlerini cloud’da çalıştırmaya ve insanlara erişim vermeye üşendiğimde kullanıyorum, müşterilerinize demo yapmak için de kullanabilirsiniz, böylece insanlara zorla ssh açtırmanız ve teknik detaylarıyla uğraşmanız gerekmez.</p><h3>Gazpacho</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e4SkVja2f5fSH6YBrw0O1A.png" /><figcaption>Kaynak: Gazpacho’nun kendi PyPI sayfası</figcaption></figure><p><a href="https://calmcode.io/gazpacho/introduction.html">Gazpacho</a>’yu calmcode’dan öğrenmiştim. Bu kütüphanenin iyi tarafı kendisine ait dependency’lerinin olmaması. Basit şekilde veri kazıma (scraping) için kullanıyorum.</p><h3>Pyenv</h3><p>Sanallaştırma projenizin dependency’lerini ve python versiyonlarını kolay yönetmenizi ve başka insanların da projenizi sorunsuz çalıştırmasını sağlar. Bilmeyenler için <a href="https://calmcode.io/virtualenv/intro.html">sanallaştırma</a> eğitim serisini altı çizili şekilde link’e koydum. Ben sanallaştırma için pyenv kullanıyorum. Farklı sanal ortamlar için bir <a href="https://github.com/merveenoyan/ultimate-venv-cheatsheet">cheatsheet</a> oluşturdum, içinde komutlar da mevcut. Bir proje için python 3.7.6 kullanıyordum ve conda’da bunun gibi bazı ara versiyonların yüklenmediğini farkettiğim için pyenv kullanmaya başladım.</p><p>Yazıya zamanla ekleme yapacağım.</p><p>Bütün bu araçların ve kütüphanelerin ve daha fazlasının rehberlerinin host edildiği calmcode.io’ya ve geliştiricisi Vincent’a teşekkür ederim.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a14602dbf7fb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Yazılımcı olarak yurtdışı/uzaktan iş bulma üzerine]]></title>
            <link>https://merveenoyan.medium.com/yaz%C4%B1l%C4%B1mc%C4%B1-olarak-yurtd%C4%B1%C5%9F%C4%B1-uzaktan-i%C5%9F-bulma-%C3%BCzerine-ce3d5260d2a?source=rss-763008f53ee9------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce3d5260d2a</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[remote-working]]></category>
            <category><![CDATA[job-opportunities]]></category>
            <dc:creator><![CDATA[Merve Noyan]]></dc:creator>
            <pubDate>Mon, 03 May 2021 13:58:02 GMT</pubDate>
            <atom:updated>2021-05-03T13:58:02.309Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OqCSMR3f-AL3CnGpMLgQyQ.jpeg" /><figcaption>Kaynak: Geekbot</figcaption></figure><p>Geçtiğimiz ay, Facebook’ta çalışan Android geliştiricisi Hadi Tok ve Superpeer’a uzaktan çalışmış geliştirici ve tasarımcı Adem İlter’le “yurtdışında yazılım tarafında iş bulma” temalı bir discord yayını yapmıştık, bu yayında sesli şekilde soru aldığımız için yayını kaydetmedim, bundan ötürü yazan çok fazla kişi oldu. Hem yayında neler konuşulduğunu anlatmak hem de Birleşik Krallık’ta bir scale-up’ta çalışan biri olarak kendi deneyimlerimi anlatmak istedim.</p><p>Şansın fırsat maksimizasyonu üstüne kurulduğuna inanıyorum, gerçekten işi hakettiğinize inanıyorsanız fırsatlarınızı arttırmaya bakın. Hadi ve Adem’le ilk konuştuğumuz şey işi en iyi şekilde yapmak gerektiğiydi. Yurtdışındaki iş piyasası çok rekabetli olduğu için “neden beni almalılar?” sorusuna iyi bir cevabınızın olması gerek. Türkiye’de okuldan çıkar çıkmaz iş deneyimi olmadan yurtdışında çalışmak istediğini belirten arkadaşlar görüyorum, bu çok zor bir ihtimal olmakla birlikte önce Türkiye’de iş öğrenip ardından uzaktan ya da yurtdışında iş bulmakta fayda var çünkü şirketler giriş seviyesi işlere kendi ülkelerinden çalışan almayı tercih ederler. <strong>“Hiç işe girmedim, Türkiye’de işe girmek için ne yapmam gerek?”</strong> diye sorarsanız, kendi portfolyonuzu oluşturup işverenlere ihtiyaçları olan araçları yeterince bildiğinizi göstermeniz gerek. Yaptığınız uçtan uca projeleri (bu bir veri bilimi projesi olabilir ya da bir mobil uygulama olabilir) github profilinizde iyi bir README ile sergilemek, iyi şekilde kodunuzun dokümantasyonunu yazmak bile artıdır. Medium gibi platformlarda işinizle ilgili makaleler yazmak da iş görür. Bunun dışında Türkiye’deki ve Dünya’daki yazılım topluluklarına katılıp işverenlerle bir araya gelmek, sizin gibi insanlarla tanışıp etkinliklere katılmak, bootcamp’lere katılıp proje yapıp bunları sergilemek, ağınızı genişletmek fırsatlarınızı arttırmanıza yardımcı olur. Açık kaynak kodlu platformlara sahip şirketlerin açık kaynak sprint’lerine katılmak ya da github’larında açık issue’larını çözmek de o şirketlerde iş bulmanızı sağlar, zamanında bu şekilde çok sevdiğim bir şirketten teklif almıştım. Bunun dışında start-up/scale-up’ta çalışan insanlara ulaşıp pozisyon var mı diye sorabilirsiniz, başvuru yaparken daha küçük şirketlere başvurmanız hem hızlı şekilde işe girmenize hem de çok iş öğrenmenize yardımcı olur.</p><p><strong>Ben nasıl işe girdim? Neden yurtdışındaki bir şirket için çalışmayı seçtim? </strong>Özellikle çalıştığım alanda rekabet çok fazla, yüksek lisans ya da doktora mezunu veri bilimci aranıyor. Ben bu bariyeri herkesin bilmediği bir chatbot framework’üyle (Rasa) çalıştığım için aştım ama bundan önce bir Türk firmasıyla çalışmıştım zaten, direkt giriş seviye bir işe girmedim. Bunun dışında iş aradığım dönemde bana bir kelle avcısı ulaştı, kendisinin İngiltere’deki start-up ve scale-up’lar için alım yapan bir şirketi var. Şansımı deneyeyim dedim ve hem kültürü hem de maaşı iyi bulduğum için yoluma şu anda çalıştığım şirketle devam ettim. Çalıştığım şirkette dünyanın her yerinden insan var ve gerçekten hoşgörülüler, anlayışlılar, ve güzel bir kültür mevcut. Eğer daha az maaş teklif etselerdi de burada çalışırdım sanıyorum.</p><p><strong>Deneyimli biri olarak nasıl yurtdışında iş bulabilirim? </strong>Avrupa’daki işe alım sitelerine bakabilirsiniz. Bu <a href="https://www.tablecrowdtalent.com/blog/seven-places-to-build-awareness-startups">linkte</a> beni bulan kelle avcısının blog postu var, blog’da bir dizi websitesi var, bu sitelere üye olup iş bakabilirsiniz. Daha hızlı sonuç almak istiyorsanız şansınızı önce start-up’larda denemenizde fayda var. Uzaktan işe girerken girdiğiniz işin Dünya’nın başka yerlerinden işe alım yaptığına dikkat edin çünkü iş ilanlarında uzaktan dense bile işverenler kendi ülkelerinden birilerini almak isteyebiliyorlar. Linkedin’den kelle avcılarını ekleyip iş aradığınızı söyleyebilirsiniz, eninde sonunda size uygun bir iş bulunca geri dönüş yaparlar. Bunun dışında başvurabildiğiniz kadar işe başvurun, ben zamanında deneme amaçlı çok fazla şirkete başvurmuştum ve çoğu dönüş yaptı.</p><p><strong>Peki yurtdışında ya da uzaktan işlerde maaş, vergilendirme, sigorta nasıl oluyor?</strong></p><p>Yurtdışında ya işçi (employee) ya da kontratlı (contractor) şekilde çalışabiliyorsunuz. İşçi olarak çalışmak için her şeyden önce çalıştığınız şirketin bulunduğu ülkede çalışma izninizin olması gerek, böyle bir durum olduğunda maaşınızdan vergi o ülkede kesilir, Türkiye ve diğer ülkeler arasında çifte vergilendirmeyi önlemek için anlaşmalar mevcut. Eğer kontratlıysanız çalıştığınız şirkete aylık fatura kesersiniz ve vergi işlerinizi kendiniz halletmek zorundasınız. Ben dahil çok fazla insan bunu şahıs şirketi kurarak çözüyor ama yasada belli başlı açıklar olduğu için bu yolu seçmeyen çok fazla insan var. Siz şirket kurup uğraşmayı seçerseniz de şahıs şirketi masrafları ve muhasebeci masrafını maaşınız kaldıracaksa seçin (ki çok büyük masraflar değiller). İşveren konumunda olduğunuz için aylık Bağkur ödüyorsunuz. Güzel tarafı eğer gitme gibi bir niyetiniz varsa işe uzaktan kontratlı olarak başlayıp bir süre sonra çalıştığınız şirketten işçi vizenize sponsor olmalarını isteyip taşınabilirsiniz.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce3d5260d2a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>