<?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 Ayesha Siddiqua  on Medium]]></title>
        <description><![CDATA[Stories by Ayesha Siddiqua  on Medium]]></description>
        <link>https://medium.com/@ayeshasiddiqua.connects?source=rss-884242aca667------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*up27FulBTJFYQu_zRPvXgw.jpeg</url>
            <title>Stories by Ayesha Siddiqua  on Medium</title>
            <link>https://medium.com/@ayeshasiddiqua.connects?source=rss-884242aca667------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 00:17:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ayeshasiddiqua.connects/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[Neural Collapse Phenomenon]]></title>
            <link>https://medium.com/@ayeshasiddiqua.connects/neural-collapse-phenomenon-240f1467465d?source=rss-884242aca667------2</link>
            <guid isPermaLink="false">https://medium.com/p/240f1467465d</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Ayesha Siddiqua ]]></dc:creator>
            <pubDate>Mon, 02 Feb 2026 09:56:01 GMT</pubDate>
            <atom:updated>2026-02-02T09:56:01.591Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZIVT5hA04K1EWl6qksqaUg.jpeg" /></figure><p>In the absence of context, the term ‘Neural Collapse’ is perceived as a failure or termination of the network’s process. But in fact, it is the greatest feature a deep neural network architecture can achieve over time.</p><h4>Why ‘Collapse’ is Good</h4><p>It is quite surprising to know that this collapse or occurrence is not programmed to happen, but instead arises naturally within the artificial neural network. Now the question stands ‘when’ and ‘why’ this happens?</p><p>The aim of training a neural network is to find the best set of weights and biases for which the loss is as small as possible. Over time, the model learns the minute details from the observed data and becomes an ideal system for generalization, meaning the training error approaches zero. After this, the network doesn’t stop there; it continues to a stage called <strong>Terminal Phase of Training(TPT)</strong>, where the neural network keeps on optimizing or refining itself to minimize loss on the training data, irrespective of the model’s perfect classification. This is achieved through a phenomenon called <strong>neural collapse</strong>. Pushing the model even further(more epochs, more optimization) might look like an overfitting case for many, but it actually makes the model generalize better to unseen data because of the finest representation it has achieved on seen data.</p><p>While the model is undergoing the TPT stage, it goes through multiple steps to eventually achieve the neural collapse. So yes, this isn’t an instantaneous process, but it emerges progressively.</p><h4>Behind the Collapse</h4><p>The road to achieving the perfect neural network involves going through four phases. The changes with each step are evident in the feature space of the <strong>last hidden layer</strong> of the classifier. And clearly, these events become more discernible with each passing epoch. It is also to be noted that these stages are sequential, meaning the next stage only unfolds when the previous stage is fulfilled or almost completed.</p><p><strong>Within-Class Feature Clustering: </strong>This is the first phase that leads to neural collapse. It focuses on accumulating essential features within a class and forming a robust representation in a way that it is closer to its mean value in the feature space. For an unsupervised network, it is the clustering of similar features into tight groups(unsupervised network), and for a supervised network, it is combining alike labelled attributes into a single geometry.</p><p>For instance, an image classifier would group every cat image into a single, tight cluster in feature space, irrespective of how visually different they appear, because the network learns that they all share essential ‘cat-ness’ features. Consequently, prediction is improved because it reduces the within-class variance(the spread of datapoints)</p><p>To understand mathematically, consider ’n’ cat images in the training set and let f(x) be the feature output of the last hidden layer for the ‘ith’ cat image input. The aim is to minimize inter-class variance and converge data points to the centroid(mean). The inter-class variance is expressed as follows</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/190/0*ntaApl6ZjWp5rU5F" /><figcaption>( 1 )</figcaption></figure><p>For all cat images to converge to the mean, the above summation must equal zero, which is possible when</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/233/0*wbVFshQAoBLkE_9U" /><figcaption>( 2 )</figcaption></figure><p>The above condition is only reached once the network traverses through multiple epochs and brings each data point closer to the mean value.</p><p><strong>Between-Class Simplex Formation: </strong>The second phase deals with maximizing intra-class variance in contrast to minimizing inter-class variance in the first phase. The aim is to increase the distance between clusters to minimize confusion during testing. As a consequence, a simplex <strong>Equiangular Tight Frame(ETF)</strong> is formed in the feature space, an equally spaced and equally angled geometric structure between each class mean.</p><p>If there are three classes in a classifier, then the feature space would present ETF as an equilateral triangle. For example, suppose we have a cat-dog-fox classifier with the following respective class means as</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/103/0*ZaeAoHRek8322_K_" /><figcaption>( 3 )</figcaption></figure><p>Then the Euclidean distance between one class and any other class mean is constant, signifying that an equidistant and equiangular simplex is formed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/233/0*t35vJCwrSkNL-fIV" /><figcaption>( 4 )</figcaption></figure><p><strong>Weight Alignment:</strong> In the third phase, the classifier weights become proportional to their corresponding class means. Initially, the weights are random and are not aligned, but during training, the network automatically align weights with emerging patterns. After multiple epochs, when the neural collapse is achieved, the individual class weights become proportional to their respective central value.</p><p>It is also notable that the ratios of class means to aligned weights are uniform across all clusters. This is because of the scaling factor λ. From the early stages of training, lambda varies inconsistently across all classes but gradually stabilizes to reach a constant value over time. The lambda value is not manually instructed; it emerges automatically during training. Moreover, if the classifier weights are proportional to class means, then it serves as evidence that the network has converged to an optimal geometric configuration.</p><p>For example, the class mean for the cat and dog cluster is [0.8,0.9] and [0.2,0.3] respectively. The network updates the weights to point toward their respective means using a quantifying factor lambda, which emerges during the neural collapse process. The value of lambda is taken as 0.5 in this case below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/0*NdSt2uPCcS-SId35" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/399/0*-zFwJAzy2s0NNKfS" /><figcaption>( 5 )</figcaption></figure><p>The aligned class weights for the cat and dog cluster are [0.4,0.45] and [0.1,0.15], respectively.</p><p><strong>Maximum margin activation: </strong>In terms of timeline, stages 3 and 4 are a simultaneous process, as during stage 3, the decision boundary is already working to move towards the optimal position. However, the decision boundary only reaches maximum margin after complete weight alignment. The boundary also becomes a perpendicular bisector at exactly the midpoint between class means or clusters.</p><p>The final position of the boundary is in such a way that the margin(distance) between the boundary and the class means is maximum. The large value of the margin provides a big advantage in terms of a buffer zone, which helps in correctly classifying noisy new data. As mentioned above, let us consider a two-class example of cat and dog.</p><p>cat cluster mean=[0.8,09]</p><p>dog cluster mean=[0.2,0.3]</p><p>After weight alignment, the decision boundary sits at the midpoint between these two cluster means, i.e., [0.5,0.6].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/249/0*sYZsFWrLe-C3admT" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/354/0*QZ5xVG5LMQY5oTa2" /><figcaption>( 6 )</figcaption></figure><p>The equation of the boundary in two dimensional feature space network is given as</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/183/0*95POwwyfGYE2DOfH" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/353/0*12dXxLmgbbE6-gjc" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/282/0*sFLyNE3rUCHLyN4b" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/155/0*pJEIq-BW6j3XWACJ" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/100/0*ThwQy68A2V4AK2ZC" /><figcaption>( 7 )</figcaption></figure><p>The distance of the boundary equation to both cat and dog clusters is equal to 0.424, confirming that the maximum margin has been achieved.</p><p>Through the four sequential phases, a deep neural network organizes itself into a mathematically perfect geometry. This emerges automatically from simple loss minimization, showing that neural networks inherently seek optimal geometric solutions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=240f1467465d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Docker: Simplifying Software Development & Deployment]]></title>
            <link>https://medium.com/@ayeshasiddiqua.connects/docker-simplifying-software-development-deployment-01d49e5f8fef?source=rss-884242aca667------2</link>
            <guid isPermaLink="false">https://medium.com/p/01d49e5f8fef</guid>
            <category><![CDATA[virtualization]]></category>
            <category><![CDATA[dockerhub]]></category>
            <category><![CDATA[software-deployment]]></category>
            <category><![CDATA[containerization]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Ayesha Siddiqua ]]></dc:creator>
            <pubDate>Mon, 06 May 2024 15:16:31 GMT</pubDate>
            <atom:updated>2024-05-08T07:04:51.135Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2YhhVBHme19w8iwxBQeOTQ.jpeg" /></figure><p>While Docker has been a familiar presence in the tech world for lot of time, its importance has spewed in the recent years, making it a essential skill for developers to achieve.</p><p>If you look at the statistics, it is clear that its demand is growing through passing years.<em> Why is that?</em></p><p>Docker has become one of the popular tool for managing dependencies through containerisation. Just like the containers used for shipping, it allows the developers to package their application with all the necessary libraries, configurations, and dependencies in portable containers.</p><p>Docker plays an important role in both developing and deployment of applications. On larger scale, the application built by the development team with all required services is handed over to the operations team. The operations team is required to replicate the same environment locally as present in the developing phase. This is not an easy task, the team has be careful on what versions of services they are configuring and the process will differ with different OS.</p><p>This was the situation before using Docker, where setting up the environment was a difficult and mistake-prone task. However, Docker has transformed this process by introducing containerized technology. Each dependency is bundled in a container along with the application’s code, and a single command is needed to create an isolated environment on host machines that configures all the necessary services for the application. The operations team no longer needs to install the services on their local environment!</p><h4>What is Docker by definition?</h4><p>Docker is a linux-based platform as a service(PaaS) product that use OS-level virtualization to deliver software in packages called containers.</p><p>Since docker is also a virtualization tool, then how is it different from virtual machine?</p><p>The difference lies in which part of the OS they virtualize. The OS consists of 3 layers: the Hardware layer (e.g., memory and CPU), the Applications layer, and the OS kernel (which acts as a bridge between hardware and software i.e. the applications layer).</p><p>When a <em>docker image</em> is installed, it virtualizes only the applications layer on top of host kernel while the VM virtualizes its own OS that has its own kernel and applications layer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*pPJbKoyenF4fxkAckmNjWQ.png" /></figure><h4>Architecture of Docker</h4><p>Docker architecture components are:</p><ul><li>Images</li><li>Containers</li><li>Registries</li><li>Docker engine</li></ul><p>let’s take a look at them one by one.</p><p><strong>Images</strong> are blueprints of creating containers, they can be considered as snapshots of software environment frozen in time. Images can be taken from <a href="https://hub.docker.com/">DokerHub</a> directly or can be created on own. Suppose I have a MongoDB application. To integrate MongoDB into my application, I need to download the MongoDB image from Docker Hub. However, as docker images serve as snapshots of software environments, sometimes it becomes necessary to customize the environment to specific requirements. This is where Dockerfiles come into play. <strong>Dockerfiles</strong> are script files that contains instructions to automate the process of building a docker image. The instructions guide the Docker engine on how to assemble an image.</p><p>To get the Docker image to connect to my MongoDB app, I need to create a <strong>container </strong>that sets up the running environment for the image and connects it to my application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*oOfZiT8eRIDeMfR9etFcjw.png" /></figure><p>These containers are kept in a container repository or <strong>registry</strong>. DockerHub is a public repository for Docker images or containers. Companies also have their private repositories where they store and share images.</p><p><strong>Docker engine</strong> is the core component of the docker architecture which deals with creation, management, and execution of containers. It consists of-</p><ul><li><strong>Docker daemon</strong>: It runs on host machines and manages images, containers, networks(communication between containers), and volumes(provides persistent data storage). Daemon listens to docker API requests and performs the required tasks.</li><li><strong>Docker CLI</strong>: Provides an interface through which the user can perform various tasks on containers by writing simple commands.</li></ul><p>By leveraging docker engine, developers can ease the process of development and deployment without worrying about the environment related issues.</p><h4>Docker Compose</h4><p>In previous section, we saw how Docker simplifies management of single-container mongoDB application. However, it’s common for many applications to have more than just a single container. Your application might require combination of containers that includes databases, cache servers for proper functioning of app. Managing each of these containers individually can become complex and hence docker compose is used.</p><p>Docker compose is a tool that cuts down the work of multi-container applications where a single command is required to deploy and run containers. It creates a YAML(.yaml) file which defines the services included in the application. By encapsulating the configurations in .yaml file, it simplifies the management of complex application and ensuring efficient deployment process.</p><p>Docker significantly streamlines app deployment through the management of containerized environments, fostering consistency across devices, scalability, and efficiency in development workflows.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=01d49e5f8fef" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>