<?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 Unnikrishnan Menon on Medium]]></title>
        <description><![CDATA[Stories by Unnikrishnan Menon on Medium]]></description>
        <link>https://medium.com/@menon.uk1998?source=rss-ebd804e98237------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*U0-qYcfp1kehBmRE.</url>
            <title>Stories by Unnikrishnan Menon on Medium</title>
            <link>https://medium.com/@menon.uk1998?source=rss-ebd804e98237------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 21:56:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@menon.uk1998/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[Demystifying DCI-VTON: Diffusion-Based Conditional Inpainting for Virtual Try-On]]></title>
            <link>https://medium.com/tryon-labs/demystifying-dci-vton-diffusion-based-conditional-inpainting-for-virtual-try-on-45cea4e01c91?source=rss-ebd804e98237------2</link>
            <guid isPermaLink="false">https://medium.com/p/45cea4e01c91</guid>
            <category><![CDATA[diffusion-models]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Unnikrishnan Menon]]></dc:creator>
            <pubDate>Wed, 27 Mar 2024 11:17:54 GMT</pubDate>
            <atom:updated>2024-03-27T11:17:54.387Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pcCAxu9wA-OjWRhPbmjDPw.png" /></figure><p>With the rising popularity of Diffusion models in this era of Generative AI, Virtual Try-On is an application that has attracted many researchers. It synthesizes new composite images by combining the characteristics of different images thus providing a more comprehensive virtual experience for consumers. This is a complex task with a variety of challenges such as generating the required garment in the correct orientation, preserving its finer details, and retaining the characteristics of the target human to generate a realistic output.</p><p>The diffusion model has recently surfaced as a promising alternative for producing top-tier images across a range of applications as compared to Generative Adversarial Networks (GANs) which suffer from issues like mode collapse. This article aims to concisely explain the <strong>Diffusion-based Conditional Inpainting for Virtual Try-ON (DCI-VTON)</strong> mechanism proposed in the paper <strong>“Taming the Power of Diffusion Models for High-Quality Virtual Try-On with Appearance Flow”</strong> (paper link =<a href="https://arxiv.org/pdf/2308.06101.pdf"> https://arxiv.org/pdf/2308.06101.pdf</a>) which seeks to employ diffusion models to achieve virtual try-on by framing it as an inpainting task.</p><p>The official GitHub implementation link for this paper:<a href="https://github.com/bcmi/DCI-VTON-Virtual-Try-On/tree/main?tab=readme-ov-file"> https://github.com/bcmi/DCI-VTON-Virtual-Try-On/tree/main?tab=readme-ov-file</a></p><p>DCI-VITON utilizes 2 main models to produce virtual try-on outputs:</p><h3><strong>Warping Network</strong></h3><p>This model is responsible for warping the cloth image so that its orientation aligns with the pose and physical characteristics of the human. This is done using a “<strong>Parser Based Appearance Flow Network (PB-AFN)</strong>” which generates a set of coordinate vectors, each indicating which pixel in the cloth image should be used to fill in a given pixel in the human image. [PB-AFN paper link: <a href="https://openaccess.thecvf.com/content/CVPR2021/papers/Ge_Parser-Free_Virtual_Try-On_via_Distilling_Appearance_Flows_CVPR_2021_paper.pdf">https://openaccess.thecvf.com/content/CVPR2021/papers/Ge_Parser-Free_Virtual_Try-On_via_Distilling_Appearance_Flows_CVPR_2021_paper.pdf</a>]</p><p>In DCI-VITON, the inputs for the warping module are the cloth image I𝒸 along with the Human Segmentation Map Sₚ (this segmentation map is cloth agnostic to prevent the cloth in the input human image from creating interference) and the Densepose map P concatenated along the channel dimension.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I8Co3cAQ7m7yBE2pnEiyLA.png" /><figcaption>Overview of the method described in the DCI-VTON paper. Taken from Fig. 2 of the paper: <a href="https://arxiv.org/pdf/2308.06101.pdf">https://arxiv.org/pdf/2308.06101.pdf</a></figcaption></figure><p>The underlying module of PB-AFN is an Appearance Flow Warping Module which utilizes two modules, namely a dual branch Pyramid Feature Extract Network (PEFN) and an Appearance Flow Estimation Network (AFEN). PEFN extracts two branches of pyramid features, one for <em>I𝒸</em> and another for Sₚ<em> </em>&amp;<em> </em>P, across N levels. AFEN contains N Flow Networks, where the iᵗʰ network takes in the extracted pyramid features at the iᵗʰ level as well as the flow output of the (i-1)ᵗʰ Flow Network to produce a more refined flow. The cloth image is warped according to the Nᵗʰ flow output.</p><p>DCI-VITON utilizes the Total Variation Loss given by:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/239/1*e1DeOFZ7CrKEiarGGivwNg.png" /></figure><p>Where Fᵢ is the iᵗʰ flow output. The total variation loss helps smoothen the warped result despite the high degrees of freedom in the appearance flow mechanism.</p><p>To preserve the finer details of the cloth image such as repeating patterns or text, a Second-Order Smoothing Constraint is added to the loss function:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*1bm4rINwiPkC7rori_9wPA.png" /></figure><p>Where Fᵢᵗ is the tᵗʰ point in Fᵢ, Nₜ is the set of horizontal, vertical, and both diagonal neighbors around the tᵗʰ point. 𝒫 denotes the generalized charbonnier loss function.</p><p>Additionally, the Perceptual loss and L₁ loss are also utilized in the final loss function given by:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/1*EnMoInnnPba8S0Y7zIzHFA.png" /></figure><p>λ_<em>VGG</em>, λ_<em>TV,</em> and λ_<em>sec</em> are hyperparameters that dictate the contributions of each of the individual loss functions. DCI-VITON sets these values to 0.2, 0.01, and 6 during experiments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*FGvLvzqxS1OgG5mQBpkTVQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*FLBCzdeW3uUXZ94Zw6_ulg.png" /></figure><p>Where M𝒸 indicates the mask of I𝒸(the cloth image) and S𝒸 is the clothes mask of Iₚ (person image) respectively, <em>W</em> is the warping function, <em>D</em> is the downsampling function and Φₘ indicates the mᵗʰ feature map of a pre-trained VGG-19 network.</p><h3><strong>Diffusion Model</strong></h3><p>Given a person image Iₚ and cloth image I𝒸, the aim of the diffusion model is to combine them into a realistic image that has the same person attributes as Iₚ while keeping the cloth element from I𝒸.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XfN2sPNEEWU3P9IgqdDpEQ.png" /><figcaption>Training pipeline for the Diffusion Model taken from Fig. 3 of <a href="https://arxiv.org/pdf/2308.06101.pdf">https://arxiv.org/pdf/2308.06101.pdf</a></figcaption></figure><p>The diffusion model training pipeline described in the paper is divided into 2 branches namely the Reconstruction branch and Refinement branch, both of which are optimized simultaneously during training.</p><h4><strong>Reconstruction Branch</strong></h4><p>The aim of the reconstruction branch is to learn how to generate the complete person wearing the desired cloth from a Gaussian Distribution. It operates akin to the standard diffusion model, employing a reverse diffusion process to generate realistic images. The authors use a Latent Diffusion Model (LDM) which operates in the latent space rather than pixel space in order to significantly reduce the computational complexity during training as well as allow for a provision to add conditioning using mechanisms like Cross-Attention.</p><p>The ground truth image <em>(I₀)</em> is converted to a latent representation <em>(z₀)</em> using an Encoder, <em>z₀ = E(I₀)</em>. The corresponding Decoder of the same Autoencoder can be used to reconstruct the pixel-space images from the latent representation. The main diffusion steps of noising and denoising are performed on this latent space representation.</p><p>The forward noising process is then performed on <em>z₀</em> as per</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/469/1*9VT8chSjUsZzj60AUJLE4A.png" /></figure><p>𝛽 is a pre-defined variance schedule in 𝑇 steps.</p><p>In order to maintain the characteristics of the cloth image as well as information regarding the desired orientation of the cloth on the person, a local condition is provided as a guide at each denoising step. These local conditions are created by adding the warped image to the inpainting image to obtain <em>I_lc</em>, which is transformed to the latent space as <em>z_lc = E(I_lc)</em>. The denoising is done by an enhanced Diffusion UNet which takes <em>{z</em>ₜ<em>, z_lc, m}</em> concatenated along the channel dimension as input. Here <em>m</em> is the inpainting mask spanning the torso and arms region and it is used to inform the model about the regions it needs to focus the denoising on. This allows the model to address poor warping results and irregularities in areas where the cloth and body meet. Moreover, a global condition <em>c</em>, obtained from <em>I𝒸</em> via the frozen pre-trained CLIP Image Encoder, is incorporated by the UNet via Cross-Attention to emphasize the retention of cloth image features. Therefore, the reconstruction branch uses the following loss function:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/403/1*uA0OvuGRXJdU7pjCiuIGYA.png" /></figure><p>where ϵ_θ is the noise predicted by the model.</p><p>While the reconstruction branch can eventually generate a synthetic image of the person and the general characteristics of the cloth, the refinement branch is required to capture the finer details of the cloth.</p><h4><strong>Refinement Branch</strong></h4><p>The Refinement Branch helps capture details about the cloth such as thickness, orientation, and color of patterns as well as their spatial information. In order to do this, while ensuring that the final results conform to the results generated by the reconstruction branch, the refinement branch utilizes the coarse result (combination of warped cloth <em>Ĩ𝒸</em> and cloth agnostic <em>Iₐ</em> ) as initial condition <em>I₀’</em> along with the local and global conditions used in the Reconstruction branch.</p><p>The latent space representation of <em>I₀’</em> is obtained as <em>z</em>₀<em>’= E(I</em>₀<em>’)</em> after which the forward noising process is conducted to obtain <em>z</em>ₜ<em>’</em>. The UNet diffusion model then takes <em>{z</em>ₜ<em>’, z_lc, m}</em> concatenated along the channel dimension as input and outputs the predicted noise ϵ̂. The refined denoised latent variable <em>ẑ </em>can be obtained by denoising using the reverse equation of the noising process. The pixel space representation of the final predicted image can be obtained as I<em>̂ = Ɗ(ẑ)</em> where <em>Ɗ</em> is the Decoder function.</p><p>The loss function for the Refinement Branch is defined as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*4zhbWrlEkQ9v7W_DrrRFWg.png" /></figure><p>where <em>Igt</em> denotes the ground truth image</p><p>On combining the losses, the main objective function used for training the diffusion model becomes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/403/1*fV4T1sHfkvTq0eO9driSJA.png" /></figure><p>where <em>λ_perceptual</em> is a hyperparameter used for balancing the 2 loss components.</p><h3><strong>Experiments</strong></h3><p><strong><em>Dataset</em></strong></p><p>The authors have performed extensive benchmarking tests of their proposed model on the VITON-HD dataset which contains 13,679 frontal-view woman and top clothes image pairs at the resolution of 1024×768.</p><p><strong><em>Training the warping module</em></strong></p><ol><li>100 epochs using Adam optimizer at a learning rate of 5x10–5.</li><li><em>λ_VGG</em> = 0.2, <em>λ_TV</em> =0.01, <em>λ_sec</em> = 6</li><li>Trained under 256x192 resolution.</li></ol><p><strong><em>Training the diffusion model</em></strong></p><ol><li>Latent space with spatial dimension of c(H/f)(W/f), where channel dimension c=4.</li><li>AdamW optimizer at a learning rate of <em>1x10–5</em>.</li><li><em>λ_perceptual</em>= 1x10–4</li><li>Trained on 2 NVIDIA Tesla A100 GPUs for 40 epochs.</li></ol><p>Here are some of the impressive results that the authors of the paper have managed to achieve:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*GVAL6pjBCWcYk_F_DRkjNA.jpeg" /><figcaption>Taken from Fig. 5 of DCI VTON paper: <a href="https://arxiv.org/pdf/2308.06101.pdf">https://arxiv.org/pdf/2308.06101.pdf</a></figcaption></figure><p>The above image depicts how well the model can fit the cloth image onto the human’s original image while preserving the pose and the details of the garment.</p><p>The following image further highlights the model’s ability to preserve the finer details of the garment like striped patterns while warping it as per the human’s pose.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*UAl-5IpNim9PKUOU-rdLVw.png" /><figcaption>Taken from Fig. 4 of DCI VTON paper: <a href="https://arxiv.org/pdf/2308.06101.pdf">https://arxiv.org/pdf/2308.06101.pdf</a></figcaption></figure><p>Special credits to <a href="https://medium.com/@menon.uk1998">Unnikrishnan Menon</a> and <a href="https://medium.com/@anirudhrajiv1999">Anirudh Rajiv Menon</a> for compiling this article.</p><h4>About Tryon Labs:</h4><p>We are building Tryon AI that empowers online apparel stores with Generative AI for Virtual Try-On and Cataloging. Online fashion stores spend a lot on photographers, models, and studios to create catalogs. Online shoppers sometimes struggle to pick clothes that will look nice on them.</p><p>Tryon AI cuts costs on cataloging for online fashion stores and improves the shopping experience for customers. Online fashion stores can offer a seamless and immersive way to try on clothes online from the comfort of their homes.</p><p>Check out our open-source implementation of TryOnDiffusion: <a href="https://github.com/tryonlabs/tryondiffusion">https://github.com/tryonlabs/tryondiffusion</a></p><p>Visit our website: <a href="https://tryonlabs.ai/">https://www.tryonlabs.ai</a> or contact us at contact@tryonlabs.ai</p><p>Join our discord server: <a href="https://discord.gg/FuBXDUr3">https://discord.gg/FuBXDUr3</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=45cea4e01c91" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tryon-labs/demystifying-dci-vton-diffusion-based-conditional-inpainting-for-virtual-try-on-45cea4e01c91">Demystifying DCI-VTON: Diffusion-Based Conditional Inpainting for Virtual Try-On</a> was originally published in <a href="https://medium.com/tryon-labs">TryOn Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Revamped Federated Analytics for Ravenverse!]]></title>
            <link>https://medium.com/ravenprotocol/an-update-on-federated-analytics-in-ravenverse-9b8f7989948b?source=rss-ebd804e98237------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b8f7989948b</guid>
            <category><![CDATA[federated-learning]]></category>
            <category><![CDATA[distributed-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Unnikrishnan Menon]]></dc:creator>
            <pubDate>Tue, 20 Sep 2022 13:31:13 GMT</pubDate>
            <atom:updated>2022-09-20T14:55:38.885Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*llXmRqzdmko3WpALGS-Jhw.jpeg" /></figure><p>On top of Distributed Computing, the Ravenverse now also has support for Federated Analytics (FA), a technique useful for conducting data analysis without directly observing a client’s private data. You can read more on FA <a href="https://ai.googleblog.com/2020/05/federated-analytics-collaborative-data.html">here</a>.</p><p>This post dives deeper into the working of our improved FA release.</p><h3>Requester and Provider</h3><p>In Ravenverse, the Requester is the entity that wants to conduct analysis of statistical metrics across data that is hosted on devices across the globe. They can define certain constraints and filters that the data must conform to. The Ravenverse bridges the gap between the Requesters and these devices by allowing only those devices with valid data (satisfying the constraints) to participate without exposing any private data.</p><p>On the other hand, Providers are entities that host cleaned data locally. For instance, it could be the medical records of patients in a hospital.</p><p>For the sake of this demo, we will be considering an arbitrary dataset of Office data that consists of 4 columns hosted on the Provider.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*I7oi1XA20myBj1iSUSXkHA.png" /><figcaption>Sample Office Data</figcaption></figure><h3>Getting your Ravenverse Token</h3><p>Visit the <a href="https://www.ravenverse.ai/">Ravenverse Website</a> (preferably on Chrome) and login using your MetaMask Wallet Credentials. More details on account creation can be found in <a href="https://medium.com/@sebastianhrw/enter-the-ravenverse-4686323b370e">this article</a>.</p><p>Copy your Private Ravenverse Token. This token will be required by all Raven libraries to authenticate transactions and data transfers.</p><h3>Setup</h3><p>Clone the <a href="https://github.com/ravenprotocol/ravenverse">Ravenverse Repository</a></p><pre>git clone <a href="https://github.com/ravenprotocol/ravenverse.git">https://github.com/ravenprotocol/ravenverse.git</a></pre><p>It is recommended to create a conda virtual environment with python 3.8 for Ravenverse.</p><p>Now inside the cloned folder, install the Python dependencies</p><pre>pip install -r requirements.txt</pre><h3>Requester Side</h3><p>Inside the Requester subfolder, you should find a .env file in which you need to paste your Ravenverse token.</p><h4>Running the Script</h4><p>The Requester’s script (<a href="https://github.com/ravenprotocol/ravenverse/blob/master/Requester/create_federated_analytics.py">Ravenverse/Requester/create_federated_analytics.py</a>) utilizes the Ravop library to compile and execute FA ops. In this demo, we will be finding the mean, variance and standard deviation of the Office Data hosted on the Provider.</p><pre>cd Requester/</pre><pre>python create_federated_analytics.py</pre><p>Let’s dive deeper into the script.</p><p>Importing the libraries</p><pre>import os<br>from dotenv import load_dotenv<br>load_dotenv() <br>import json<br>import ravop as R</pre><p>First, we initialize the requester with their Ravenverse token, after which we clear any previous/existing graphs using the R.flush() method. Note that the initialize function of Ravop fetches the token directly from the .env file.</p><pre>R.initialize(ravenverse_token=os.environ.get(&quot;TOKEN&quot;)) <br>R.flush()</pre><p>Next, we define a FA Graph (along with the required data constraints) which groups the forthcoming ops under one roof. This graph is now owned by the Requester.</p><pre>R.Graph(name=&quot;Office Data&quot;, approach=&quot;federated&quot;,<br>            rules=json.dumps(<br>                  {&quot;rules&quot;: {&quot;age&quot;: {&quot;min&quot;: 18, &quot;max&quot;: 80},<br>                             &quot;salary&quot;: {&quot;min&quot;: 1, &quot;max&quot;: 5},<br>                             &quot;bonus&quot;: {&quot;min&quot;: 0, &quot;max&quot;: 10},<br>                             &quot;fund&quot;: {}<br>                            },<br>            &quot;max_clients&quot;: 1}))</pre><ul><li>name: The name for the graph set by the requester. Preferably a meaningful name that allows clients to identify the type of dataset desired by the requester.</li><li>approach: Set to ‘federated’.</li><li>rules: The rules dictionary must contain the names of all the columns of data required by the requester for aggregation and their corresponding constraints as shown above. The clients will then be able to filter their data accordingly. Note: An empty dictionary for a column signifies no constraints. All values in that column shall be considered.</li><li>max_clients: The number of clients whose data must be aggregated and returned to the requester.</li></ul><p>Next, we define Ops for our statistical analysis.</p><pre>mean = R.federated_mean()<br>variance = R.federated_variance()<br>standard_deviation = R.federated_standard_deviation()</pre><p>Next, we make our Ops Persist. Ops that have been set to persist can later be retrieved after the execution of the graph is complete.</p><p><strong><em>Note:</em></strong> Make sure that the name parameter for each persisting Op is unique within a graph so that later it can be retrieved.</p><pre>mean.persist_op(name=&quot;mean&quot;)<br>variance.persist_op(name=&quot;variance&quot;)<br>standard_deviation.persist_op(name=&quot;standard_deviation&quot;)</pre><p>Once all Ops of the graph has been defined, the requester must activate their graph. This step completes the compilation procedure and makes the graph ready for execution. No more Ops can be added to the graph after this.</p><pre>R.activate()</pre><p>Upon Activation, the Ravenverse compiles the defined Ops and notifies the Requester of how many Raven Tokens it will cost to execute their graph.</p><p>Next, we execute the FA graph. On execution, the Provider nodes will be allowed to participate if they possess the relevant data on their systems. The requester can also track the progress of the graph.</p><pre>R.execute()<br>R.track_progress()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QqtNq0zVboo2UqsE6Uq9fg.png" /><figcaption>Compilation and Execution of FA graph</figcaption></figure><p>Once executed, the Requester can fetch the computed results of the Ops that they had previously set to persist.</p><pre>mean_output <strong>=</strong> R<strong>.</strong>fetch_persisting_op(op_name<strong>=</strong>&quot;mean&quot;)<br>print(&quot;mean: &quot;, mean_output)<br><br>variance_output <strong>=</strong> R<strong>.</strong>fetch_persisting_op(op_name<strong>=</strong>&quot;variance&quot;)<br>print(&quot;variance: &quot;, variance_output)<br><br>standard_deviation_output <strong>=</strong> R<strong>.</strong>fetch_persisting_op(op_name<strong>=</strong>&quot;standard_deviation&quot;)<br>print(&quot;standard_deviation: &quot;, standard_deviation_output)</pre><p>These fetched ops will contain a dictionary of values corresponding to each row in the dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i6qJ9noXf6Drq9D7e7FlsQ.png" /><figcaption>The output of fetched FA ops</figcaption></figure><h3>Provider Side</h3><p>Inside the Provider subfolder, you should find a .env file in which you need to paste your Ravenverse token.</p><h4>Running the Script</h4><p>The Provider’s script (<a href="https://github.com/ravenprotocol/ravenverse/blob/master/Provider/run_federated_provider.py">Ravenverse/Provider/run_federated_provider.py</a>) utilizes the Ravpy library to view and participate in existing FA graphs. The Office Data (shown earlier) is already included in the Provider subfolder (<a href="https://github.com/ravenprotocol/ravenverse/blob/master/Provider/data/data1.csv">Ravenverse/Provider/data/data1.csv</a>).</p><pre>cd Provider/</pre><pre>python run_federated_provider.py</pre><p>Let’s dive deeper into this script…</p><p>Importing the libraries</p><pre>import os<br>from dotenv import load_dotenv<br>load_dotenv() <br>from ravpy.utils import list_graphs<br>from ravpy.federated.participate import participate<br>from ravpy.initialize import initialize</pre><p>First, we initialize the provider with their Ravenverse token. Note that the initialize function of ravpy fetches the token directly from the .env file.</p><pre>client = initialize(os.environ.get(&quot;TOKEN&quot;))</pre><p>Next, we list the currently active graphs in which the provider can potentially participate.</p><pre>list_graphs(approach=&quot;federated&quot;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ohYBJnE9YRPsQ9pyyf3YXQ.png" /><figcaption>Listing currently active graphs</figcaption></figure><p>After viewing the rules, the Provider can participate in the graph execution with their local dataset. <strong><em>Note:</em></strong> The dataset must be a .csv file.</p><pre>participate(graph_id=1, file_path=&quot;data/data1.csv&quot;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/876/1*GcO0DQHD40jg4_cl2R96Xw.png" /><figcaption>Participation Logs</figcaption></figure><p>After participation, the Provider will be aptly rewarded with Raven Tokens that they can view and withdraw into their Metamask wallet, from their Ravenverse Website dashboard.</p><h3>Join Our Community</h3><p>Raven’s GitHub Repositories welcome contributions from developers. We’ll be releasing new versions of Ravenverse and related libraries on a regular basis.</p><p><a href="https://github.com/ravenprotocol">Raven Protocol</a></p><p>Join our discord server to get updates on what comes next</p><p><a href="https://discord.com/invite/DEZTX2u7">Join the Raven Dev Community Discord Server!</a></p><p>Join us on Telegram</p><p><a href="https://t.me/ravenprotocol">Raven Protocol</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b8f7989948b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ravenprotocol/an-update-on-federated-analytics-in-ravenverse-9b8f7989948b">Revamped Federated Analytics for Ravenverse!</a> was originally published in <a href="https://medium.com/ravenprotocol">RavenProtocol</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Announcing Support for Federated Analytics in Raven Distribution Framework (RDF)]]></title>
            <link>https://medium.com/ravenprotocol/announcing-support-for-federated-analytics-in-raven-distribution-framework-rdf-b0e6efd337f9?source=rss-ebd804e98237------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0e6efd337f9</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[distributed-computing]]></category>
            <category><![CDATA[federated-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Unnikrishnan Menon]]></dc:creator>
            <pubDate>Tue, 15 Feb 2022 09:20:03 GMT</pubDate>
            <atom:updated>2022-02-15T15:57:24.967Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jdeLNenQt2nQY7xucrIA9Q.jpeg" /></figure><p>Federated Analytics is the latest feature added to Raven Distribution Framework that allows for the safe dynamic aggregation of statistics such as mean, variance, and standard deviation across data that is privately held on several clients. RDF’s Ravop library now supports the creation of federated operations which developers can leverage to conduct analysis without directly observing a client’s private data.</p><h3>What is Federated Analytics?</h3><p>Federated analytics is a new approach to data analysis in which key statistics like mean, variance, and standard deviation can be calculated across various private datasets without compromising privacy. It operates similarly to federated learning in that it runs local calculations over each client device’s data and only makes the aggregated findings — never any data from a specific device — available to developers. Sensitive data like medical records, financial transactions, employee data, and others can be analyzed without leaving the premise. Refer to the below links to learn more:</p><ul><li><a href="https://ai.googleblog.com/2020/05/federated-analytics-collaborative-data.html">Federated Analytics: Collaborative Data Science without Data Collection</a></li><li><a href="https://clarkboyd.medium.com/hi-tech-explains-federated-analytics-f92fb70e54c4">hi, tech. Explains: Federated analytics</a></li></ul><h3>How does RDF facilitate Federated Analytics?</h3><p>The latest <a href="https://github.com/ravenprotocol/raven-distribution-framework/releases/tag/0.3">RDF version (v0.3)</a> contains an updated <a href="https://github.com/ravenprotocol/ravop">Ravop</a> library that supports the creation of federated operations. These operations are inherently different from the traditional distributed computation ops that were already supported. While in distributed computing, the op along with its requisite data is sent to the contributing client, federated ops utilize data that is locally hosted on a client’s system.</p><p>Developers can utilize Ravop to define a set of “rules” that the client’s data must abide by in order to filter out data that is irrelevant to the developer’s requirement. RDF now seamlessly integrates with a new Python client (<a href="https://github.com/ravenprotocol/ravpy">Ravpy</a>) which calculates the required statistics locally without exposing its private data. The client’s dataset is first validated according to the “rules” defined by the developer, following which, a data silo with the appropriate columns containing values in the defined range is prepared. At this stage, the client locally evaluates the required statistics on its data silo.</p><p>Before transmitting their local stats for aggregation, the clients have the option to add a layer of homomorphic encryption for enhanced security.</p><p>These local stats are then uploaded onto Raven’s FTP Server (<a href="https://github.com/ravenprotocol/ravftp">Ravftp</a>). The central server <a href="https://github.com/ravenprotocol/ravsock">Ravsock</a> then fetches and aggregates them with values received from the other participating clients. The maximum number of participating clients in a federated analytics graph is declared within the “rules” set by the developer. Once enough clients have participated, the aggregated results are returned to the developer.</p><h3>Usage</h3><h4>1. Configure RDF</h4><p>Make sure RDF is configured correctly and Ravsock server is up and running. Refer to the following article for more details:</p><p><a href="https://kailashahirwar.medium.com/how-to-set-up-raven-distribution-framework-rdf-e0c5e388ad27">How to set up Raven Distribution Framework(RDF)?</a></p><h4>2. Developer Side</h4><p>Create a federated analytics graph by providing its name, approach, and rules to which clients must adhere.</p><pre>import ravop as R</pre><pre>graph = R.Graph(name=&quot;Office Data&quot;, approach=&quot;federated&quot;,<br>            rules=json.dumps(<br>                  {&quot;rules&quot;: {&quot;age&quot;: {&quot;min&quot;: 18, &quot;max&quot;: 80},<br>                             &quot;salary&quot;: {&quot;min&quot;: 1, &quot;max&quot;: 5},<br>                             &quot;bonus&quot;: {&quot;min&quot;: 0, &quot;max&quot;: 10},<br>                             &quot;fund&quot;: {}<br>                            },<br>            &quot;max_clients&quot;: 3}))</pre><ul><li>Name: The name for the graph set by the developer. Preferably a meaningful name that allows clients to identify the type of dataset desired by the developer.</li><li>Approach: Set to ‘federated’.</li><li>Rules: The rules dictionary must contain the names of all the columns of data required by the developer for aggregation and their corresponding constraints as shown above. The clients will then be able to filter their data accordingly. Note: An empty dictionary for a column signifies no constraints. All values in that column shall be considered.</li><li>Max Clients: The number of clients whose data must be aggregated and returned to the developer.</li></ul><h4>Creation of Federated Ops</h4><p>The following code snippet creates and adds ops to the previously declared graph.</p><pre>mean = R.federated_mean() <br>variance = R.federated_variance() <br>standard_deviation = R.federated_standard_deviation()</pre><p>The results of aggregation can be fetched by calling the aforementioned ops.</p><pre># Wait for the results<br>print(&quot;\nAggregated Mean: &quot;, mean())<br>print(&quot;\nAggregated Variance: &quot;, variance())<br>print(&quot;\nAggregated Standard Deviation: &quot;, standard_deviation())</pre><p>The results will be ready once max_clients number of clients have participated.</p><p>Note: The proper way of wrapping up ops in a graph is by calling graph.end() at the end of the code. This checks for any failed ops and lets the developer know.</p><h4>Sample Test Code</h4><pre>python federated_test.py</pre><h4>3. Client Side</h4><p>As of now, Federated Analytics is natively supported by Raven’s Python Clients (Ravpy).</p><p>Upon configuration, RDF ensures that Ravpy gets properly installed.</p><p>For a client to view the available pending graphs and their corresponding data rules:</p><pre>python run_client.py --action list</pre><p>The client must note the graph_id for the graph in which it wants to participate.</p><p>For the client to participate in its desired graph:</p><pre>python run_client.py --action participate --cid 123 --federated_id &lt;graph_id&gt;</pre><p>Note: The cid argument is a unique username provided by the client.</p><p>The terminal will then prompt the client to provide the path for its dataset.</p><p>The data can be placed inside /ravpy/data/ folder. The data must be a .csv file containing at least all columns mentioned in the graph&#39;s rules in any order.</p><h3>Conclusion</h3><p>You can now set up RDF and test our new secure federated analytics feature on your custom datasets. Developers are welcome to contribute to Raven’s <a href="https://github.com/ravenprotocol">GitHub repositories</a>. We will be actively releasing new versions of RDF and its libraries.</p><p><a href="https://github.com/ravenprotocol">Raven Protocol</a></p><p>Join our discord server to get updates on what comes next</p><p><a href="https://discord.com/invite/DEZTX2u7">Join the Raven Dev Community Discord Server!</a></p><p>Join us on Telegram</p><p><a href="https://t.me/ravenprotocol">Raven Protocol</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0e6efd337f9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ravenprotocol/announcing-support-for-federated-analytics-in-raven-distribution-framework-rdf-b0e6efd337f9">Announcing Support for Federated Analytics in Raven Distribution Framework (RDF)</a> was originally published in <a href="https://medium.com/ravenprotocol">RavenProtocol</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why is Space So Dark?]]></title>
            <link>https://medium.com/@menon.uk1998/why-is-space-so-dark-653cb17bb528?source=rss-ebd804e98237------2</link>
            <guid isPermaLink="false">https://medium.com/p/653cb17bb528</guid>
            <dc:creator><![CDATA[Unnikrishnan Menon]]></dc:creator>
            <pubDate>Thu, 06 Apr 2017 13:48:33 GMT</pubDate>
            <atom:updated>2017-04-06T13:48:33.612Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*XWPJKvHKe6MGqK5K." /></figure><blockquote><strong><em>Why is Space So Dark?</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*xgvF-TwKTHjLRtcI." /></figure><p>I mean, there are innumerable numbers of Stars out there right? Countless number of them which are all as bright as our own Sun. (or more)<br> Our cosmos is so big that no matter in which direction you look, you’ll always stumble upon a cluster of stars or galaxies! From this reasoning, our sky should be appearing bright 24 X 7, no matter what time you pick. So, why don’t we see this???</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*lsA3VwZR9nNhtHwj." /></figure><p>All of our evidences seem to indicate that space has no edge. But the Universe itself does have one! Now this is not spatial edge but this is a temporal one. Our current understanding of the Cosmos suggests that it had a beginning. This beginning was about 13.7 billion years ago when our Universe was so small and crumpled up with itself that our current notion of space and time simply breaks down at that point!<br> Now as I said, only a finite amount of time (13.7 billion yrs) has passed since the beginning of our Cosmos. What that means is when we point out telescopes at the heavens, we are able to see only those stars whose light has been able to reach us. So some of the stars necessary to fill up the brightness in every direction are so far away that the photons of light that are emitting haven’t yet reached us ! This is somewhat similar to what happens during a Thunderstorm…</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*JOi_bpzDtzAE0BQm." /></figure><p>You first see a flash of light in the sky, the lightning. After that there’s a time delay. And after this time delay, you get to hear the roar of the thunder! It takes some time for the sound to reach us.<br> But there’s more to this story….<br> Let’s say you were looking at the night sky using your telescope. You point your telescope at a particular direction and suddenly, you spot a lonely star. Let’s say Star-X.<br> Let’s say a photon left the surface of that star in 1917. Now the Star X is so far away from us that this photon had to travel for the next hundred years. So starting from 1917 to 2017, this photon was sailing through the Universe. Now when you saw that star, what really happened is that the photon entered your eye. So basically, what you are seeing in the telescope is an image of the star but that’s not how it looks at present. That’s how it looked like in 1917! You are gazing at the past!</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*IY5x0K3R9qKyUVrX." /></figure><p>What’s even more fascinating (atleast to me) is the fact that some of these stars may be dead by now (at present), but because of the vastness of this Cosmos, the last photon that left that star’s surface hasn’t reached us yet! They can be thought of like ghosts. They are not there but we can still see them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*kd0VW0lPqJl6Qxl4." /></figure><p>So when we look up at the night sky, what we are really seeing is the past of our Cosmos. We see that part of the Universe as it had been when the light was emitted. So when we look at 13.5 billion year old light, it’s not that we don’t see stars just because the light from them hasn’t reached us yet. We don’t see stars because we are getting a peak at the Universe BEFORE any stars had formed! How crazy is that! A Starless Universe!<br> We can find points in the sky where there aren’t any stars by looking past the earliest stars and thus further back in time! But even when we point our telescopes past the earliest stars, we still see LIGHT! This is weird because this is not Starlight but it is the light left over from the Big Bang! That’s what Astrophysicists like to call as the <strong><em>Cosmic Background Radiation.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*BeFKqJuv6IoUaZXb." /></figure><p><em>So, the night sky really isn’t that dark in the first place!</em>And we see this coming more or less evenly from all directions! That’s what our marvellous telescopes tell us. If you are wondering why we can’t see this Cosmic light, here’s why…</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*vbA5CHsK7DfZJDQY." /></figure><p>Our high resolution telescopes like The Hubble, use<strong><em> Infrared </em></strong>cameras. Distant stars and galaxies are moving away from us as the Universe is expanding. So, the <strong><em>Doppler Effect </em></strong>spoils the fun by making the light appear <strong><em>Redder</em></strong> to us! Yeah that’s <strong><em>Redshifting of Light.</em></strong> So, the further away they are, the faster they are moving away from us and they also appear to be more Redder!</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*GcEqHGV-W2a2t6bG." /></figure><p><em>Now the degree of Redshift the Light from the Big Bang undergoes is enormous. So much that the light </em><strong><em>no longer</em></strong><em> comes under the </em><strong><em>Visible part of the Spectrum!</em></strong><em> It becomes </em><strong><em>Infrared Light</em></strong><em>. And since the infrared light can be detected by cameras, our telescopes are able to capture them but not our curious Human Eyes.</em><br> Infrared images look something like this…</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*72ZIIm6w4T7fXdW6." /></figure><p>Thanks For Reading :)</p><p><em>Originally published on </em><a href="http://ift.tt/2p4SWD9"><em>Blogger</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=653cb17bb528" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>