<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>channelCS</title><link href="/" rel="alternate"></link><link href="/feeds/all.atom.xml" rel="self"></link><id>/</id><updated>2018-06-11T00:00:00+05:30</updated><entry><title>Working with the Open Innovation Team</title><link href="/working-with-the-open-innovation-team.html" rel="alternate"></link><published>2018-06-11T00:00:00+05:30</published><updated>2018-06-11T00:00:00+05:30</updated><author><name>Akshita Gupta</name></author><id>tag:,2018-06-11:working-with-the-open-innovation-team.html</id><summary type="html">&lt;p&gt;&lt;em&gt;This is the second of the series of posts through my journey as an Outreachy intern at Mozilla.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I commenced my Outreachy internship officially on May 14, 2018.&lt;/p&gt;
&lt;p&gt;In the first week of May, I communicated with my mentors and members of the &lt;strong&gt;Open Innovation Team&lt;/strong&gt; on how to take up tasks assigned to me, what should I anticipate from the internship and what all stuff they expect me to do. I must say, my team members are quite friendly when it comes to explaining me the duties. &lt;/p&gt;
&lt;h2&gt;Getting welcomed on Slack&lt;/h2&gt;
&lt;p&gt;I got a Slack invite on the very first day my internship started. I got a warm welcome from all the community members at Mozilla. They were pretty cheerful. I went through the previous discussions that happened on various channels such as &lt;code&gt;#participationsystems&lt;/code&gt; and &lt;code&gt;#oiteam&lt;/code&gt;. I have been discussing my tasks on Slack itself.&lt;/p&gt;
&lt;h2&gt;What I have done so far?&lt;/h2&gt;
&lt;p&gt;The very first task allotted was to get my hands on the &lt;em&gt;Developer Tools&lt;/em&gt; in &lt;em&gt;Community Analytics Dashboard&lt;/em&gt; from which we can get different insights about the contributors and then pick the things I find interesting. I created a workflow on giving a general introduction to the working of the dashboard that gives a smooth perception of the functionalities.&lt;/p&gt;
&lt;h2&gt;Working in the community&lt;/h2&gt;
&lt;p&gt;There are so many good people around. I talked with &lt;a href="https://twitter.com/hmitsch"&gt;Henrik&lt;/a&gt;, &lt;a href="https://twitter.com/musingvirtual"&gt;Kate&lt;/a&gt;, and &lt;a href="https://twitter.com/sunnydeveloper"&gt;Emma&lt;/a&gt; to get updates and info regarding the tasks. I like to ask things as I move forward, the tasks are so interesting and innovative.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://imgs.xkcd.com/comics/self_description.png " /&gt;&lt;/p&gt;
&lt;h3&gt;Updates&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;I got my 13" MacBook Pro 2017 model :-)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;My visa got rejected for All Hands :/&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Kate would be shipping me some stickers and Emma would be shipping all the swag to me. I'm excited to get all of these :)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Got any more questions?&lt;/h2&gt;
&lt;p&gt;Are you curious about Outreachy? Thinking of applying? Confused about the application process? Feel free to drop me an email at akshitadvlp@gmail.com. :)&lt;/p&gt;</summary><category term="Outreachy"></category></entry><entry><title>My journey at Mozilla begins</title><link href="/my-journey-at-mozilla-begins.html" rel="alternate"></link><published>2018-05-22T00:00:00+05:30</published><updated>2018-05-22T00:00:00+05:30</updated><author><name>Akshita Gupta</name></author><id>tag:,2018-05-22:my-journey-at-mozilla-begins.html</id><summary type="html">&lt;p&gt;&lt;em&gt;This would be a part of a series of posts through my journey as an Outreachy intern at Mozilla. This would not have been possible without &lt;a href="https://twitter.com/sunnydeveloper"&gt;Emma&lt;/a&gt; and &lt;a href="https://twitter.com/musingvirtual"&gt;Kate&lt;/a&gt;. Thank you so much.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;What is Outreachy?&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://www.outreachy.org/"&gt;Outreachy&lt;/a&gt; is an amazing initiative for women (cis and trans), trans men, and genderqueer people in free and open source software to get involved. If you are new to open source and searching for an internship that can boost up your confidence, Outreachy would be a great start for you.
&lt;br/&gt;&lt;br/&gt;
&lt;p align="center"&gt;
&lt;img alt="Outreachy logo" src="https://i.imgur.com/DT6QSGw.png" /&gt;
&lt;/p&gt;
&lt;br/&gt;
The seleced interns work on a given project for three months under the supervision of a Mentor. Various organisations (e.g. &lt;a href="https://www.mozilla.org/Outreachy"&gt;Mozilla&lt;/a&gt;, &lt;a href="https://wiki.gnome.org/Outreach/Outreachy"&gt;GNOME&lt;/a&gt;, &lt;a href="https://www.mediawiki.org/wiki/Outreachy/Round_12"&gt;Wikimedia&lt;/a&gt;, to name a few) take interns to work full-time on the project. The outreachy program happens twice an year and the interns are paid for their time.&lt;/p&gt;
&lt;p&gt;I’m so excited to be accepted for this year Outreachy round 16 as an intern with Mozilla community.
&lt;br/&gt;&lt;br/&gt;
&lt;p align="center"&gt;
&lt;img alt="Mozilla logo" src="https://i.imgur.com/JK57hhi.png" /&gt;
&lt;/p&gt;
&lt;br/&gt;
I am currently working with &lt;strong&gt;Open Innovation team&lt;/strong&gt; under the guidance of &lt;strong&gt;Emma Irwin&lt;/strong&gt; and &lt;strong&gt;Katherine Mancuso&lt;/strong&gt; at Mozilla. I am currently exploring the Debugger tool and its use to our current project.&lt;/p&gt;
&lt;h2&gt;How did I get involved with Outreachy?&lt;/h2&gt;
&lt;p&gt;I started engaging with Mozilla community in the beginning of February. I thought I was ready for Outreachy and pinged one of the former outreachy interns and my good friend, &lt;a href="https://www.facebook.com/vershwal"&gt;Princi Vershwal&lt;/a&gt; to get a general idea about some do's and dont's. This really helped me a lot throughout the process. &lt;/p&gt;
&lt;p&gt;I began contributing in &lt;a href="https://github.com/taskcluster"&gt;Taskcluster&lt;/a&gt; and &lt;a href="https://github.com/mozilla/diversity"&gt;Diversity&lt;/a&gt; repositories. This gave me an opportunity to get the know-hows of the working of an organisation in open source society. At first, it was really intimidating speaking in an open source community, like every message of mine was a broadcast to a crowd of people, but with time I started getting more comfortable to speak out and asking questions. The people in both these organisations were really helpful in clearing my doubts and guided me through my submissions.&lt;/p&gt;
&lt;p&gt;I really like how the community takes the code of conduct very seriously and promotes a welcoming environment for everyone. I already learned a lot from the application phase. One of the things that I learned is that we can help open source communities with more than code. &lt;/p&gt;
&lt;h2&gt;Path to Outreachy...&lt;/h2&gt;
&lt;h3&gt;Choose projects you are confident with ..&lt;/h3&gt;
&lt;p&gt;Outreachy announces the organisations on the first date and every organisation takes 1-2 interns depending upon the projects they have opened. Explore all the projects and choose one which interests you the most and you feel motivated to work on that project for the next 3–4 months. Try to stay calm with the competition and start contributing with good first issues.&lt;/p&gt;
&lt;h3&gt;Stay consistent and ask questions ..&lt;/h3&gt;
&lt;p&gt;Don't hesitate to ask questions. This does not means that if you are stuck somewhere, you immediately ping the other person. If a problem can be solved by a simple Google search, do that before. Being an intern with outreachy teaches us patience and consistency needed for a project. Even if you are stuck with a problem for a day don't lose hope just coordinate with the fellow team-members and reach out to them on IRC or Slack channel.&lt;/p&gt;
&lt;p&gt;Don’t get disheartened if your patches are not accepted in early stages. Eventually, they would be. They just need a little more polishing. Keep going and one day you will get your PR merged!! :)&lt;/p&gt;
&lt;h3&gt;Know your project before submitting an application ...&lt;/h3&gt;
&lt;p&gt;You do not have to hurry about submitting a proposal. Get to know about your project, set up the platform, solve bugs and once you get comfortable with the code and platform then submit the application. This way you will have a better idea about the project and this will reflect from your application.&lt;/p&gt;
&lt;h2&gt;What do you get out of Outreachy?&lt;/h2&gt;
&lt;h3&gt;Knowledge and Guidance&lt;/h3&gt;
&lt;p&gt;The primary reason why I suggest people to take part in Outreachy is that you will get the opportunity to work with some of the most knowledgable people and learn valuable skills which you would require for working in the real world as well as in your day to day job.&lt;/p&gt;
&lt;p&gt;You learn how to work with remote teams which are spread geographically over the world having different time zones.&lt;/p&gt;
&lt;h3&gt;Stipend and Perks&lt;/h3&gt;
&lt;p&gt;Outreachy values the time interns give to there projects by working full time for 40 hours/week.
Each intern gets&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;$5,500 USD, and an extra $500 stipend for travel related to Outreachy, which is fantastic. Yay!!!&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;LDAP credentials. This means you get a @mozilla.com e-mail address like all regular employees. You get to take part in team meetings and have access to pretty much everything.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;A laptop to keep. What you get varies from year to year. This year they gave a 15" Macbook Pro latest model to all the interns.(Mine arrives tomorrow :) )&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Invitation to All-Hands event to meet all the mentors and spend an exciting week brainstorming and exploring !!!!!!&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Some general guidelines&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Always be respectful to your mentors and co participants while communicating.&lt;/li&gt;
&lt;li&gt;Make sure you follow the Code of Conduct of the organisation. &lt;/li&gt;
&lt;li&gt;If you see that any fellow participant is stuck on a similar doubt and you feel that you can help, just share your knowledge even if he/she is your competitor.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Getting selected is a goal but spreading knowledge and involving more people in open source is a bigger aim of Outreachy.&lt;/p&gt;
&lt;h2&gt;Got any more questions?&lt;/h2&gt;
&lt;p&gt;Are you curious about Outreachy? Thinking of applying? Confused about the application process? Feel free to drop me an email at akshitadvlp@gmail.com. :)&lt;/p&gt;</summary><category term="Outreachy"></category><category term="Opensource"></category></entry><entry><title>Best practices in a collaborative environment</title><link href="/best-practices-in-a-collaborative-environment.html" rel="alternate"></link><published>2018-04-03T00:00:00+05:30</published><updated>2018-04-03T00:00:00+05:30</updated><author><name>Akshita Gupta, Aditya Arora</name></author><id>tag:,2018-04-03:best-practices-in-a-collaborative-environment.html</id><summary type="html">&lt;p&gt;This blog post is made possible due to amazing mentors                                                                                                                                                                          &lt;a href="https://github.com/djmitche"&gt;Dustin&lt;/a&gt;, &lt;a href="https://github.com/eliperelman"&gt;Eli&lt;/a&gt;, &lt;a href="https://github.com/helfi92"&gt;Hassan&lt;/a&gt; and, &lt;a href="https://github.com/emmairwin"&gt;Emma&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This is a place for all newcomers to Open Source to get an idea for getting started with version control systems and contributing to Open Source projects. It is totally different in maintaining your own projects as compared to working with multiple people in order to create a single great product.&lt;/p&gt;
&lt;p&gt;As an Outreachy aspirant, I have been working for the past two months, solving multiple issues in Mozilla's &lt;a href="https://github.com/taskcluster/taskcluster-tools"&gt;Taskcluster&lt;/a&gt; and &lt;a href="https://github.com/mozilla/diversity"&gt;Diversity&lt;/a&gt; projects.
They have awesome mentors who have been really helpful in making me understand my mistakes. I want to share these practices with everyone in order to skip those mistakes.&lt;/p&gt;
&lt;h2&gt;1. Welcome to Open Source&lt;/h2&gt;
&lt;p&gt;If you are a newcomer, I want to welcome you to this &lt;em&gt;one-of-a-kind&lt;/em&gt; great place called as OpenSource . It is a place to showcase your work and at the same time help others to make awesome projects. Remember, &lt;strong&gt;Every organisation is different.&lt;/strong&gt; They have their own set of standards and rules to follow. In this blog post, however, I would like to give you a general introduction and practices which covers most of the organisations. &lt;/p&gt;
&lt;h3&gt;1.1 Getting Started&lt;/h3&gt;
&lt;p&gt;Firstly, go through the organisations' Github pages and look through the repositories. Find out those which interests you. Once you have selected a repo&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Go through the &lt;strong&gt;README&lt;/strong&gt; and understand the working of the project.&lt;/li&gt;
&lt;li&gt;Follow the instructions in the README and set up the project on your local machine.&lt;/li&gt;
&lt;li&gt;Explore the project's codebase. If you find any error or bug, generate an &lt;strong&gt;Issue&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;If you are unable to find anything, somebody else might have. Go to the &lt;strong&gt;Issues&lt;/strong&gt; tab of the project to find some issues being worked upon.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Don't know coding and still want to contribute?&lt;/strong&gt; Don't be disheartened. Let's get our facts correct- &lt;em&gt;A human being cannot learn every programming language.&lt;/em&gt; You might be good at writing. There are various projects that need an incredible writer like you. You can always look for the &lt;em&gt;Documentation&lt;/em&gt; tag in an Issue or generate a new one in case you find a repo that needs documentation. You can also learn while contributing. I believe, the logic of all the programming languages is similar. The major difference lies in the syntax. If you know how the project works, the syntax should not be an obstacle in your path.&lt;/p&gt;
&lt;h3&gt;1.2 Forking the repo&lt;/h3&gt;
&lt;p&gt;You cannot make changes directly to the organisation's repo. For that, you need to make a copy into your own profile. Click on the 
&lt;!-- Place this tag where you want the button to render. --&gt;
&lt;button&gt;&lt;svg viewBox="0 0 10 16" height="16"&gt;&lt;path fill-rule="evenodd" d="M8 1a1.993 1.993 0 0 0-1 3.72V6L5 8 3 6V4.72A1.993 1.993 0 0 0 2 1a1.993 1.993 0 0 0-1 3.72V6.5l3 3v1.78A1.993 1.993 0 0 0 5 15a1.993 1.993 0 0 0 1-3.72V9.5l3-3V4.72A1.993 1.993 0 0 0 8 1zM2 4.2C1.34 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3 10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3-10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"&gt;&lt;/path&gt;&lt;/svg&gt; Fork&lt;/button&gt; button to get your own copy of the repository. &lt;/p&gt;
&lt;h3&gt;1.3 Cloning the repo&lt;/h3&gt;
&lt;p&gt;You can now clone the repo in a local system to make the changes. Type&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;git clone https://github.com/&amp;lt;your-username&amp;gt;/&amp;lt;repo-name&amp;gt;.git
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;in bash to get the repository on your computer.&lt;/p&gt;
&lt;h2&gt;2. Working on issues&lt;/h2&gt;
&lt;p&gt;You might have found a bug or want to work on an Issue that interests you. If you found a bug, go through the &lt;button&gt;&lt;svg class="octicon octicon-issue-opened" viewBox="0 0 14 16" version="1.1" width="14" height="16" aria-hidden="true"&gt;&lt;path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"&gt;&lt;/path&gt;&lt;/svg&gt; Issue&lt;/button&gt; tab to see if an issue is already generated or not. If not, you may generate a new issue.&lt;/p&gt;
&lt;h3&gt;2.1 Asking to get assigned&lt;/h3&gt;
&lt;p&gt;Make sure you ask for permission from the mentors before working on an issue as there might be other people who could already be working on that issue. A simple message such as&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;Hey, I want to work on this issue. Is it already assigned?
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;will do the work. &lt;/p&gt;
&lt;h3&gt;2.2 Wait for the response&lt;/h3&gt;
&lt;p&gt;You have to understand that people live in various parts of the world and have different timelines. They might be having a holiday which might be a working day in your country. Also, they might be working on multiple projects. You must take care of all the factors and should not keep messaging in order to get a reply. &lt;/p&gt;
&lt;h3&gt;2.3 Make your changes&lt;/h3&gt;
&lt;p&gt;Once you get the approval from a mentor, go ahead and make the changes as per the issue. &lt;strong&gt;Don't make any unnecessary changes.&lt;/strong&gt; Examples are
- Introducing new lines.
- Removing and adding spaces.
- Changes other than the assigned issue.
- Changing the workflow of the project.&lt;/p&gt;
&lt;p&gt;These should be evaluated first before making a commit.&lt;/p&gt;
&lt;h2&gt;3. Getting Stuck&lt;/h2&gt;
&lt;p&gt;As a newcomer, it is obvious that you might get stuck at a place where you might not understand what is going wrong. &lt;strong&gt;Don't panic&lt;/strong&gt; .Others might have also faced similar issues.&lt;/p&gt;
&lt;h3&gt;3.1 Checking versions&lt;/h3&gt;
&lt;p&gt;If these are the cases, follow the README in the repo to correct your mistakes. Make sure you are on the right version as that told in the repository.
- There might be certain dependencies which only work on a specific Operating System.
- Certain functions could be deprecated or renamed in newer versions of a library.
- The programming language might follow newer syntax rules as compared to previous versions.&lt;/p&gt;
&lt;h3&gt;3.2 Searching for a solution&lt;/h3&gt;
&lt;p&gt;Others who got the same problem could have asked on the web for a solution. In most cases, you might get the remedy on &lt;em&gt;StackOverflow&lt;/em&gt;. A good practice is to try to solve the problem and if you are unable to, copy the exact error in &lt;em&gt;Google&lt;/em&gt; and look for the solutions.&lt;/p&gt;
&lt;h3&gt;3.3 Asking the mentors&lt;/h3&gt;
&lt;p&gt;This should be the last resort and make sure you do this only after you have followed the above two steps and done an extensive research but are still unable to get a remedy for your problem. Generate a message containing
- The problem you are facing.
- What solutions you have tried.
- Links to solutions you have tried.
- Relevant screenshots.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Value their time.&lt;/strong&gt; Don't ask irrelevant questions as they are giving you, their time by answering your query. It can be a bit annoying for the reviewers if you ask unnecessary questions which might already be on Google.&lt;/p&gt;
&lt;h2&gt;4. Pull requests&lt;/h2&gt;
&lt;p&gt;When creating a Pull Request (&lt;em&gt;also called a PR&lt;/em&gt;), there are certain practices which give better results.&lt;/p&gt;
&lt;h3&gt;4.1 Add your files&lt;/h3&gt;
&lt;p&gt;If you are working on a single issue, you can use&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;git add .
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;However, this is not suggested for multiple issues and you should only add the desired files for which changes were &lt;em&gt;required&lt;/em&gt; using&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;git add filename.py
&lt;/pre&gt;&lt;/div&gt;


&lt;h3&gt;4.2 Squashing your commits&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;One PR needs one commit&lt;/strong&gt;. Squash all your commits into a single commit.&lt;/p&gt;
&lt;p&gt;Remember, Branching is the key to avoid all the commit problems.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;git checkout &amp;lt;branch name&amp;gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Merging 5 commits to a single commit.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;git rebase -i &amp;lt;branch name&amp;gt;~5 &amp;lt;branch name&amp;gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;At the Interactive screen, choose fixup for commit 2 / 3 / 4 / 5.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;git push -u origin &amp;lt;branch name&amp;gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Commit Related issues?&lt;/strong&gt; If you have any issues regarding commits, go ahead and see this &lt;a href="https://channelcs.github.io/wrong-files-added-in-commit.html"&gt;post&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;4.3 Generating a Pull Request&lt;/h3&gt;
&lt;p&gt;Separate PRs should be generated for different issues. If not, they get mixed and create a ruckus when everything is done on the master branch.
In order to create better PRs, it is recommended that you should create PRs on a branch which could be named as &lt;code&gt;solves-issue-21&lt;/code&gt;. This not only helps in working on multiple issues simultaneously but also makes the collaborator at the other end, understand what the PR does.&lt;/p&gt;
&lt;h3&gt;4.4 Creating a new branch&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Add a new branch for pushing our changes to an issue.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;git checkout -b &amp;lt;branch-name&amp;gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If required, rebase your branch even to master by following the rebase &lt;a href="#rebase"&gt;steps&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Push the changes to your repo.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;git push origin &amp;lt;branch-name&amp;gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;5.Rebasing your repository&lt;/h2&gt;
&lt;h3&gt;5.1 What is a Rebase?&lt;/h3&gt;
&lt;p&gt;Rebasing is changing the base of your branch from one commit to another making it appear as if you'd created your branch from a different commit. &lt;/p&gt;
&lt;h3&gt;5.2 Why is it needed?&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;The forked repository is few commits behind.&lt;/li&gt;
&lt;li&gt;Newly created branch is not even with the master branch.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;5.3 How to rebase?&lt;a name='rebase'&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Check current configured forked repository&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;git remote -v
&lt;/pre&gt;&lt;/div&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Set new remote repository that will be synced&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;git remote add upstream &amp;lt;original-github-repo-link&amp;gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Check new upstream repository&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;git remote -v
&lt;/pre&gt;&lt;/div&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Fetch the original Github repository&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;git fetch upstream
&lt;/pre&gt;&lt;/div&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Rebase the commits&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;git rebase -i upstream/master
&lt;/pre&gt;&lt;/div&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Push the changes &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;git push -f
&lt;/pre&gt;&lt;/div&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Rebase commits against a specific branch and then proceed with Step 6&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;git rebase -i &amp;lt;branch-name&amp;gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Rebase commits against a specific node and then proceed with Step 6&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;git rebase -i HEAD~&amp;lt;commit-number&amp;gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;6. List of open-source competitions and Internships.&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://wiki.mozilla.org/Security/Automation/Winter_Of_Security_2016"&gt;Mozilla Winter of Security&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.gnome.org/outreachy/"&gt;Outreachy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://railsgirlssummerofcode.org/"&gt;RGSOC&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="https://trac.torproject.org/projects/tor/wiki/org/TorSoP"&gt;TOR Summer of Privacy&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.google-melange.com/gci/homepage/google/gci2014"&gt;GCI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.google.com/open-source/gsoc/"&gt;GSOC&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="https://wiki.opendaylight.org/view/Interns"&gt;OpenDaylight summer internship program&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.dataone.org/internships"&gt;DataONE Summer Internship Program&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.fsf.org/volunteer/internships"&gt;Free Software Foundation Internship&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://rada.re/r/rsoc.html"&gt;Radare Summer of Code&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="https://summer.haskell.org/"&gt;Summer of Haskell&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://open.segment.com/fellowship"&gt;Segment Open Fellowship&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://2017.summerofcode.be/"&gt;Open Summer of Code&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://lab.codingblocks.com/boss/"&gt;Bountiful Open Source Summer- BOSS&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="https://hacktoberfest.digitalocean.com/"&gt;Hacktoberfest&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://halite.io/"&gt;Halite AI Bot Challenge&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://sigmm.org/Resources/software/ossc"&gt;ACM MM Open Source Software Competition&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;7. Sources&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://help.github.com/articles/about-git-rebase/"&gt;Github Help&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.hackerearth.com/getstarted-opensource/"&gt;How to get started with Open Source&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://opensource.com/life/15/2/developers-guide-getting-involved-open-source"&gt;A developer's guide to getting into open source&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://eulercoder.me/2017/07/getting-started-open-source/"&gt;Getting Started with Open Source&lt;/a&gt;
-&lt;a href="https://www.linuxfoundation.org/resources/open-source-guides/starting-open-source-project/"&gt;Starting an Open Source Project&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.smashingmagazine.com/2013/01/starting-an-open-source-project/"&gt;How To Start An Open-Source Project&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.freecodecamp.org/how-to-start-an-open-source-project-in-new-years-945bad8800d7"&gt;How to start an Open Source project&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.firsttimersonly.com/"&gt;Welcome! Let’s do some open source!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://opensource.guide/"&gt;Open Source Guides&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://git-scm.com/book/en/v2/Git-Branching-Rebasing"&gt;Git Rebasing &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/tapasweni-pathak/SOC-Programs/blob/master/README.md"&gt;SOC-Programs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</summary><category term="Outreachy"></category><category term="Opensource"></category></entry><entry><title>Gender Identity</title><link href="/gender-identity.html" rel="alternate"></link><published>2018-03-24T00:00:00+05:30</published><updated>2018-03-24T00:00:00+05:30</updated><author><name>Akshita Gupta</name></author><id>tag:,2018-03-24:gender-identity.html</id><summary type="html">&lt;p&gt;Gender identity and expression is a positive, core part, of being human and experiencing wellbeing and fulfilment. We shall be discussing about the various aspects that needs to be taken care in order to design community guidelines.&lt;/p&gt;
&lt;h2&gt;What exactly is Gender identity&lt;a name='what-exactly-is-gender-identity'&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;Gender identity is one's personal experience of one's own gender.
&lt;div style="text-align: right"&gt;- Wikipedia&lt;/div&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Gender identity can be the sex at birth or can differ as well. The social identity of a person, in relation to other members of society is served by their &lt;strong&gt;set of gender categories&lt;/strong&gt;. Most societies have a &lt;em&gt;gender binary&lt;/em&gt; which is a basic division between gender attributes assigned to &lt;strong&gt;males&lt;/strong&gt; and &lt;strong&gt;females&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;In all societies, some individuals do not identify with some (or all) of the aspects of gender that are assigned to their biological sex; some of those individuals are &lt;strong&gt;transgender&lt;/strong&gt;, &lt;strong&gt;genderqueer&lt;/strong&gt; or &lt;strong&gt;non-binary&lt;/strong&gt;. There are some societies that have &lt;strong&gt;third gender&lt;/strong&gt; categories.&lt;/p&gt;
&lt;h2&gt;Role of age in Gender Identity&lt;a name='role-of-age-in-Gender-Identity'&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;This gives an insight for issue &lt;a href="https://github.com/mozilla/diversity/issues/96"&gt;#96&lt;/a&gt; in Mozilla/Diversity.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Core gender identity is usually formed by age three, although children do not yet fully understand the implications of gender. &lt;/p&gt;
&lt;p&gt;Trans people who express their gender identity from an early age are often rejected by their families. If not cast out from their homes, they are shunned within households resulting in lack of opportunities for education and with no attempts to ensure attention to their mental and physical health needs. &lt;/p&gt;
&lt;p&gt;In universities, students aged under 18 are covered by special policies because they are in a distinct legal position because of their age and should obtain the assistance of a Student Adviser when, for example, seeking to change their student records.&lt;/p&gt;
&lt;h3&gt;Gender Recognition Laws&lt;/h3&gt;
&lt;p&gt;In certain countries, like Ireland, a certificate is issued under the Gender Recognition Act which enables trans people’s binary gender to be legally recognised from age &lt;strong&gt;sixteen&lt;/strong&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A person over the age of 18 years should be able to choose to have an unspecified sex noted on documents and records. 
&lt;div style="text-align: right"&gt;- United Nations&lt;/div&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;Gender Reassignment Therapy&lt;/h3&gt;
&lt;p&gt;Another aspect in discussing about gender identity is access to gender reassignment therapy.Trans persons may elect to undergo gender reassignment surgery, which is usually available after a person has reached 18 years of age. However, in some countries, like the Netherlands, transgender youth may begin treatment to offset puberty and 
receive counselling, so as to allow them to make informed decisions about their future gender identity. Then at the age of 18 they can proceed with gender reassignment treatments, if they still wish to. Recently, some other countries, for example Belgium and Germany, have started 
to provide similar treatment for youth under &lt;strong&gt;18&lt;/strong&gt;. &lt;/p&gt;
&lt;h3&gt;Teens understanding their gender&lt;/h3&gt;
&lt;p&gt;One’s gender identity is their innermost concept of self as male, female, both, or neither. It also means that one’s gender identity can be the same or different than their sex assigned at birth. If &lt;strong&gt;a teen's&lt;/strong&gt; gender identity is different from their sex, they may be looking for &lt;strong&gt;support&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Telling a friend or an adult about their gender identity can be a very emotional journey. While there are support groups, some feel safer to be themselves and explore issues online rather than sitting across the table from someone. Online communities are vailable for people between the age of &lt;strong&gt;13 and 19&lt;/strong&gt; which they can join to connect with other Gender-expansive youth and their allies.&lt;/p&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;To conclude, I would say that the age of 19 seems to be good for asking gender identity from people.&lt;/p&gt;
&lt;h2&gt;Designing forms for gender identity&lt;a name='designing-forms-for-gender-identity'&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;This gives an insight for issue &lt;a href="https://github.com/mozilla/diversity/issues/95"&gt;#95&lt;/a&gt; in Mozilla/Diversity.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;We discuss about some best practices to inculcate the most appropriate options when it comes to gender identity based on people’s common attitudes. Having a binary question is simple form &lt;strong&gt;cisgender&lt;/strong&gt; people. But what about people who don't consider themselves in one of those category. It may be a hurtful reminder of how their journey is not reflected in the world.&lt;/p&gt;
&lt;p&gt;Trans &amp;amp; GNC people may have identified with several different gender labels as they discovered them. They may also think about pronouns they want other people to use while referring to them.
This may not be a journey to a destination, but a path. They are the ones shaping the path, creating, adopting and combining labels to feel comfort while they explore their feelings, and discarding old ones. The meaning they give to these labels can also vary.&lt;/p&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;Employers committed to diversity and inclusion should give these options: male, female, lesbian, gay, bisexual, transgender. Some thoughts to consider are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Avoid using &lt;strong&gt;only&lt;/strong&gt; binary options for Gender Identity.&lt;/li&gt;
&lt;li&gt;An individual should be allowed to select &lt;em&gt;multiple&lt;/em&gt; options.&lt;/li&gt;
&lt;li&gt;It should be &lt;strong&gt;clearly stated&lt;/strong&gt; whether they change the selected options later. &lt;/li&gt;
&lt;li&gt;Apart from the choices, having a &lt;em&gt;optional&lt;/em&gt; description for Gender Identity is a good practice.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Prefer not to say&lt;/em&gt; is always good to have.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Sources:&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Gender_identity"&gt;Wikipedia&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4949312"&gt;NIH&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.ucd.ie/t4cms/Gender%20Identity%20Policy%20Final%20June%2017.pdf"&gt;UCD&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.ijrcenter.org/thematic-research-guides/sexual-orientation-gender-identity/#gsc.tab=0"&gt;IJRCENTER&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://rm.coe.int/16806da753"&gt;COE&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.genderspectrum.org/explore-topics/teens/"&gt;GenderSpectrum&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://unstats.un.org/unsd/class/intercop/expertgroup/2015/AC289-Bk2.PDF"&gt;UN&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</summary><category term="Mozilla"></category><category term="Genders"></category></entry><entry><title>Changing Keras Version</title><link href="/changing-keras-version.html" rel="alternate"></link><published>2018-03-22T00:00:00+05:30</published><updated>2018-03-22T00:00:00+05:30</updated><author><name>Aditya Arora</name></author><id>tag:,2018-03-22:changing-keras-version.html</id><summary type="html">&lt;p&gt;Sometimes, we get errors which when looked up as &lt;strong&gt;Github issues&lt;/strong&gt; dont give us a solid answer. It is told to change &lt;strong&gt;Theano&lt;/strong&gt; versions to using &lt;strong&gt;CPU&lt;/strong&gt;. A simple trick is to downgrade your keras version from &lt;code&gt;2.1.x&lt;/code&gt; to &lt;code&gt;2.0.y&lt;/code&gt; where &lt;code&gt;y&amp;lt;=5&lt;/code&gt;.
For this we have to check which version we currently have. Also note that the previous versions are not available in &lt;code&gt;conda&lt;/code&gt;. This means we have to use &lt;code&gt;pip&lt;/code&gt;for installations. Also, we dont want to change any other dependencies as they are working well.
- Check keras version&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;$ conda list keras
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Output&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;# packages in environment at C:\Anaconda2:
#
keras                     2.1.5                    py27_0    conda-forge
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;We have &lt;code&gt;Keras 2.1.5&lt;/code&gt; and wwant to switch to &lt;code&gt;Keras 2.0.5&lt;/code&gt; without altering any dependencies. We remove keras with &lt;code&gt;--force&lt;/code&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;$ conda remove keras --force
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;We now install keras with no dependencies using &lt;code&gt;--no-deps&lt;/code&gt; flag.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;$ pip install &lt;span class="nv"&gt;keras&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;.0.5 --no-deps
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Output&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;Collecting keras==2.0.5
  Downloading Keras-2.0.5.tar.gz (216kB)
    100% |################################| 225kB 639kB/s
Building wheels for collected packages: keras
  Running setup.py bdist_wheel for keras ... done
  Stored in directory: C:\Users\dell\AppData\Local\pip\Cache\wheels\f9\8d\c5\efc2eeea676156ca5bed9
cfbdb63098c40336d7d2b269be5ea
Successfully built keras
Installing collected packages: keras
Successfully installed keras-2.0.5
&lt;/pre&gt;&lt;/div&gt;</summary><category term="Keras"></category><category term="Theano"></category><category term="Errors"></category></entry><entry><title>Open Source Data Visualization</title><link href="/open-source-data-visualization.html" rel="alternate"></link><published>2018-03-19T00:00:00+05:30</published><updated>2018-03-19T00:00:00+05:30</updated><author><name>Akshita Gupta</name></author><id>tag:,2018-03-19:open-source-data-visualization.html</id><summary type="html">&lt;p&gt;As a contributor to the Diversity team of Mozilla I have analyzed how users engage with their Open Source community. I have seen what is the gender spread across communities, their contributions on Github aing with their Employment status. The data was extracted from Github's Open Source survey from 2017.&lt;/p&gt;
&lt;h2&gt;Users who value cost&lt;/h2&gt;
&lt;p&gt;It seems that cost plays a major part of selecting a project.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Plot 1" src="https://i.imgur.com/3C3Ivgz.png" /&gt;&lt;/p&gt;
&lt;p&gt;There were a total of 4126 Users on which the survey did not have a NaN value. Out of those, 3648 people value the cost of the project which makes around 88.4% of the users.&lt;/p&gt;
&lt;h2&gt;Github Users by Gender&lt;/h2&gt;
&lt;p&gt;&lt;img alt="Plot 2" src="https://i.imgur.com/9UWFD7b.png" /&gt;&lt;/p&gt;
&lt;p&gt;It seems that the gender distribution among Github users is not that evenly distributed as 95.4 % of total Github users are men.&lt;/p&gt;
&lt;h2&gt;Employment Status of People&lt;/h2&gt;
&lt;p&gt;Full time Employed users tend to use Github more than any other users. This indicates that organisations, nowadays, are moving towards Open Source. &lt;br /&gt;
&lt;img alt="Plot 3" src="https://i.imgur.com/7GLZwhh.png" /&gt;&lt;/p&gt;
&lt;p&gt;Another aspect which can be looked at is the number of users on Github.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Plot 4" src="https://i.imgur.com/wCr9XkR.png" /&gt;
The Pie-Chart very well represents that Github is used by64.1% full time employed users.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Plot 5" src="https://i.imgur.com/dhoM0BA.png" /&gt;&lt;/p&gt;
&lt;p&gt;Also, when looked at full time employed users, we can see that women constitute only 3.5% of the total users.&lt;/p&gt;
&lt;p&gt;We shall now see how much does women contribute in code.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Plot 6" src="https://i.imgur.com/MR2b4Cf.png" /&gt;&lt;/p&gt;
&lt;p&gt;It is saddening to see that only 32.4% of the total women contribute Frequently. To solifdify if we are heading right, lets see the total number of users about whom we are talking about. There seem to be data of only about 74 women, so this measure may not be an accurate way to come to a conclusion.&lt;/p&gt;
&lt;h2&gt;Where do people get help&lt;/h2&gt;
&lt;p&gt;When analysed, it was seen that 56.0% people got help from people that they never knew before.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Plot 7" src="https://i.imgur.com/jXf48SG.png" /&gt;&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;In the end I conclude that the percentage of Women in OSS is way behind that of men. Also, OSS seems to be a friendly environment as people get help from others whom they have not known before. This creates a platform for women to come and showcase their skills.&lt;/p&gt;</summary><category term="Outreachy"></category></entry><entry><title>Using FOSS Heartbeat for generating insights in Normandy</title><link href="/using-foss-heartbeat-for-generating-insights-in-normandy.html" rel="alternate"></link><published>2018-03-19T00:00:00+05:30</published><updated>2018-03-19T00:00:00+05:30</updated><author><name>Akshita Gupta</name></author><id>tag:,2018-03-19:using-foss-heartbeat-for-generating-insights-in-normandy.html</id><summary type="html">&lt;p&gt;&lt;strong&gt;Task&lt;/strong&gt;: To analyse the FOSS Hearbeat tool and understand the health of the community. The tool uses CoreNLP algorithms and the GitHub API to
gather information about the language and etiquette expressed in the PRs and the Issues of a repository.&lt;/p&gt;
&lt;h2&gt;Why did I choose this repository?&lt;/h2&gt;
&lt;p&gt;For this task, I analysed the Mozilla's repository, &lt;a href="https://github.com/mozilla/normandy"&gt;Normandy&lt;/a&gt;. 
As per issue &lt;a href="https://github.com/mozilla/diversity/issues/89"&gt;#89&lt;/a&gt; of Mozilla's &lt;a href="https://github.com/mozilla/diversity"&gt;Diversity&lt;/a&gt;, I have been working to be a part of it through the Outreachy program. We were told to see any of active Mozilla repos from this list:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/mozilla?utf8=%E2%9C%93&amp;amp;q=firefox&amp;amp;type=&amp;amp;language="&gt;Firefox&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/mozilla?utf8=%E2%9C%93&amp;amp;q=rust&amp;amp;type=&amp;amp;language="&gt;Rust&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As most of my work revolves around python, I chose to go to the first link and find the repos that use python.
From there, I came to know about Normandy and thought it would be great to see the insights about the health of this community.&lt;/p&gt;
&lt;h2&gt;Some of the insights&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;People help each other&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt="Plot 1" src="https://i.imgur.com/89mqqAV.png" /&gt;&lt;/p&gt;
&lt;p&gt;It seems that people tend to help others as the comments made by a person on other's issue is huge.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Most issues are opened by newcomers&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt="Plot 2" src="https://i.imgur.com/77UFJoo.png" /&gt;&lt;/p&gt;
&lt;p&gt;This plot demonstrates that most issues are genrated by people who are new to the organisation. We can say that they seem to be more interested in knowing more about the project and give ideas for it as well.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Response to Pull Requests&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt="Plot 3" src="https://i.imgur.com/bI5wdDT.png" /&gt;&lt;/p&gt;
&lt;p&gt;This plot demonstrates how Normandy Maintainers respond quickly to the pull requests that are opened. The feedback is instant and very helpful!&lt;/p&gt;
&lt;h2&gt;Inference&lt;/h2&gt;
&lt;p&gt;The FOSS Heartbeat tool is mapsa various kinds of insights and gives a very encouraging statistics about the health of an oranisation.&lt;/p&gt;</summary><category term="Outreachy"></category></entry><entry><title>Wrong files added in commit</title><link href="/wrong-files-added-in-commit.html" rel="alternate"></link><published>2018-03-19T00:00:00+05:30</published><updated>2018-03-19T00:00:00+05:30</updated><author><name>Aditya Arora</name></author><id>tag:,2018-03-19:wrong-files-added-in-commit.html</id><summary type="html">&lt;p&gt;This post helps users to revert changes made while using git. We might add wrong files while committing. It is a good practice to use &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;git status
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;to check what files are currently worked on.
So this is what you have done&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Added the wrong files to the staging area&lt;/li&gt;
&lt;li&gt;Commited&lt;/li&gt;
&lt;li&gt;Not push&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;What to do now?&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Reset to the last commit&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;git reset --soft HEAD~1
&lt;/pre&gt;&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Remove folders that you dont want&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;git reset node_modules/
&lt;/pre&gt;&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Check status to see the added files in the staging area&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;git status
&lt;/pre&gt;&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Make new commits&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;git commit -m &amp;quot;Cleaning styles.css&amp;quot;
&lt;/pre&gt;&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Push the commits&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;git push -u origin master
&lt;/pre&gt;&lt;/div&gt;</summary><category term="Errors"></category></entry><entry><title>Pelican is great</title><link href="/pelican-is-great.html" rel="alternate"></link><published>2018-01-15T17:33:00+05:30</published><updated>2018-01-15T17:33:00+05:30</updated><author><name>Akshita Gupta, Aditya Arora</name></author><id>tag:,2018-01-15:pelican-is-great.html</id><summary type="html">&lt;p&gt;&lt;strong&gt;This is test page&lt;/strong&gt; If you have author rights, kindly see this page.&lt;/p&gt;</summary><category term="testing"></category></entry><entry><title>Build our first Neural Network for Audio Processing</title><link href="/build-our-first-neural-network-for-audio-processing.html" rel="alternate"></link><published>2018-01-15T00:00:00+05:30</published><updated>2018-01-15T00:00:00+05:30</updated><author><name>Aditya Arora</name></author><id>tag:,2018-01-15:build-our-first-neural-network-for-audio-processing.html</id><summary type="html">&lt;p&gt;Welcome to this post which guides you through the working of a Deep Neural Network in Audio Processing.
Prerequisites:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Up and Running with Keras&lt;/li&gt;
&lt;li&gt;Implementing DNN using Keras&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;What is different in Audio?&lt;/h2&gt;
&lt;p&gt;A standard deep learning model passes the arrays of text or images directly to the Deep Neural Network or Convolution Neural Network and the rest is done by the model itself.&lt;/p&gt;
&lt;p&gt;As far as Audio is concerned, we first extract features which are then passed to the model for training.&lt;/p&gt;
&lt;p&gt;In this tutorial, you will discover how to develop a multichannel convolutional neural network for Acoustic Scene Classification the NAR dataset.&lt;/p&gt;
&lt;h2&gt;1. Understanding the Dataset&lt;/h2&gt;
&lt;p&gt;We shall be using the NAR dataset which can be downloaded from this &lt;a href="https://team.inria.fr/perception/nard/"&gt;Link&lt;/a&gt; to the dataset. The data are freely accessible for scientific research purposes and for non-commercial applications.&lt;/p&gt;
&lt;p&gt;NAR is a dataset  of audio recordings made with the humanoid robot Nao in real-world conditions for sound recognition benchmarking.&lt;/p&gt;
&lt;h3&gt;1.a. Audio Characteristics&lt;/h3&gt;
&lt;p&gt;There are certain parameters in audio which must be considered. These tell us about how and under what conditions were the recordings made for the dataset. The audio for the NAR Dataset has the following characteristics&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;recorded with low-quality sensors (300 Hz – 18 kHz bandpass)&lt;/li&gt;
&lt;li&gt;suffering from typical fan noise from the robot’s internal hardware&lt;/li&gt;
&lt;li&gt;recorded in multiple real domestic environments (no special acoustic characteristics, reverberations, the presence of multiple sound sources and unknown locations)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;1.b. Dataset Characteristics&lt;/h3&gt;
&lt;p&gt;Now comes the details of the dataset files. These are important to consider as we have to convert everything in arrays and pass it on to the model.&lt;/p&gt;
&lt;p&gt;The dataset is organized as follows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Each class is represented by a folder containing all the audio files labeled with the class.&lt;/li&gt;
&lt;li&gt;The name of a folder is the name of the class attached. The name of an audio file is “foldername$id.wav” where $id is an incremental identifier starting at 1.&lt;/li&gt;
&lt;li&gt;Each audio file is provided in a WAV format (mono signal, 48kHz sampling rate and 16 bits per sample).&lt;/li&gt;
&lt;li&gt;42 different class for 852 sounds have been recorded and organized.&lt;/li&gt;
&lt;li&gt;We shall consider four labels &lt;strong&gt;Kitchen&lt;/strong&gt;, &lt;strong&gt;Office&lt;/strong&gt;, &lt;strong&gt;Nonverbal&lt;/strong&gt;, and &lt;strong&gt;Speech&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;2. Dataset Manipulation&lt;/h2&gt;
&lt;p&gt;After downloading, we are going to extract it in a folder named &lt;code&gt;NAR_dataset&lt;/code&gt;. The &lt;code&gt;tree&lt;/code&gt; looks something like&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;└───NAR_dataset
    ├───alarmfridge
    ├───alarmmicrowave
    ├───...
    ├───zipone
    └───ziptwo
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;We are going to make a file so that the directory structure changes to&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Scenarios&lt;/th&gt;
&lt;th&gt;Classes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Kitchen&lt;/td&gt;
&lt;td&gt;Eating, Choking, Cuttlery, Fill a glass, Running the tap, Open/close a drawer,Move a chair, Open microwave,Close microwave, Microwave, Fridge, Toaster&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Office&lt;/td&gt;
&lt;td&gt;Door Close, Open, Key, Knock, Ripped Paper, Zip, (another) Zip&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Nonverbal&lt;/td&gt;
&lt;td&gt;Fingerclap, Handclap, Tongue Clic&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Speech&lt;/td&gt;
&lt;td&gt;1,2,3,4,5,6,7,8,9,10, Hello, Left, Right, Turn, Move, Stop, Nao, Yes, No, What&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;2.a. Making the config file&lt;/h3&gt;
&lt;p&gt;We are now making a config file for feature extraction in which we  place all the details about the dataset. We call it &lt;strong&gt;&lt;em&gt;config.py&lt;/em&gt;&lt;/strong&gt;.
There is no such rule of making a config fie as everything can be placed in a single place but that creates a lot of confusion when it comes to sharing codes between multiple developers.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;os&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;CreateFolder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;fd&lt;/span&gt; &lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;exists&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fd&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;makedirs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fd&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The &lt;code&gt;CreateFolder&lt;/code&gt; comes in handy while creating multiple folders. It checks whether the folder is already present, if not it creates that folder.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;shutil&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;copytree&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;MoveFolder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;destination&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;copytree&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;destination&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Oops! Folder already exists...&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The &lt;code&gt;MoveFolder&lt;/code&gt; function will be used when we want to move certain folders from one diretory to another.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;dir_path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dirname&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;realpath&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="vm"&gt;__file__&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="n"&gt;dir_path&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;dir_path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;/&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;orig_dataset_path&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;dir_path&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;/NAR_dataset/*&amp;#39;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;We define where does all the audio files reside. In our case, we have put all our files under &lt;code&gt;Nar_dataset&lt;/code&gt; directory.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;kitchen_array&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;alarmfridge&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;alarmmicrowave&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;chair&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;closemicrowave&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;cuttlery&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;drawer&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;eat&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;openmicrowave&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;strugling&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;tap&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;toaster&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;water&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;nonverbal_array&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;fingerclap&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;handclap&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;tongue&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;office_array&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;doorclose&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;doorkey&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;doorknock&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;dooropen&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;paper&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;zipone&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;ziptwo&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;speech_array&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;eight&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;five&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;four&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;hello&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;left&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;move&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;nao&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;nine&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;no&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;one&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;right&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;seven&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;six&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;stop&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;ten&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;three&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;turn&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;two&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;what&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;yes&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;We now define which folder shall be going under which &lt;code&gt;Class Label&lt;/code&gt;. This helps in moving the folders in the defined Label.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;audio_folder&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;audios&amp;#39;&lt;/span&gt;
&lt;span class="n"&gt;kitchen_folder&lt;/span&gt;   &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;audio_folder&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;/Kitchen&amp;#39;&lt;/span&gt;
&lt;span class="n"&gt;nonverbal_folder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;audio_folder&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;/Nonverbal&amp;#39;&lt;/span&gt;
&lt;span class="n"&gt;office_folder&lt;/span&gt;    &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;audio_folder&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;/Office&amp;#39;&lt;/span&gt;
&lt;span class="n"&gt;speech_folder&lt;/span&gt;    &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;audio_folder&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;/Speech&amp;#39;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;We now define the folder names for each Class Label. &lt;strong&gt;Remember&lt;/strong&gt;, we have not made these folders yet.
the &lt;code&gt;audios&lt;/code&gt; is the main folder and all the audio files shall reside in the same folder.&lt;/p&gt;
&lt;h3&gt;2.b. Making the file manipulator file&lt;/h3&gt;
&lt;p&gt;We are now going to make a file manipulator file the actual moving of files shall take place. We call it &lt;strong&gt;&lt;em&gt;file_manipulator.py&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;h4&gt;2.b.i. Moving folders under Class Labels&lt;/h4&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;glob&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;config&lt;/span&gt; &lt;span class="kn"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;cfg&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;os&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;string&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;digits&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The &lt;code&gt;glob&lt;/code&gt; function is used to read all files inside a specified folder.
We have also imported out &lt;code&gt;config&lt;/code&gt; file here.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;audio_folder&lt;/span&gt;

&lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CreateFolder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;audio_folder&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CreateFolder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;kitchen_folder&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CreateFolder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nonverbal_folder&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CreateFolder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;office_folder&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CreateFolder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;speech_folder&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;We define the path of our audio files which can directly be taken from the config file.
We are are making folders for our audio and all the class labels.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;glob&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;glob&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orig_dataset_path&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;kitchen_array&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;MoveFolder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;kitchen_folder&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;/&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nonverbal_array&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;MoveFolder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nonverbal_folder&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;/&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;office_array&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;MoveFolder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;office_folder&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;/&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;speech_array&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;MoveFolder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;speech_folder&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;/&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;This checks where should the folder of certain audio go based in the config file and moves it.&lt;/p&gt;
&lt;p&gt;The current directory &lt;strong&gt;structure&lt;/strong&gt; looks something like:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;└───NAR_dataset
    ├───Kitchen
    ├───Nonverbal
    ├───Speech
    └───Office
&lt;/pre&gt;&lt;/div&gt;


&lt;h4&gt;2.b.ii. Renaming Wav Files&lt;/h4&gt;
&lt;p&gt;Great Work! We now have moved all our subfolders under the specified class labels.
We are going to move and rename all our &lt;code&gt;wav files&lt;/code&gt; so that they look something like:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;ClassLabel_subtype_filename.wav
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Example:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;Kitchen_alarmfridge_alarmfridge1.wav
&lt;/pre&gt;&lt;/div&gt;


&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;move_files&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;listdir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;The folder has {} subfolders&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;folder&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;new_path&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;/&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;folder&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isdir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;new_path&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
            &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;listdir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;new_path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="p"&gt;[]:&lt;/span&gt;
                &lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;Empty subfolder:&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;folder&lt;/span&gt;
            &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;file_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                    &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;rename&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;new_path&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;/&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;file_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;/&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;folder&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;_&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;file_&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;listdir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;new_path&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
                        &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;rmdir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;new_path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The function checks for non-empty subfolders and moves it. It then removes the original folder.
We have to run the function two times in order to get to the root directory level.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;glob&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;glob&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;/*&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;:]&lt;/span&gt;&lt;span class="o"&gt;!=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;.wav&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;remove&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;//&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;This deletes the DS_Store files which are not required.&lt;/p&gt;
&lt;h4&gt;2.b.iii. Generating the metafile&lt;/h4&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;str1=&amp;#39;&amp;#39;
arr1=[]
for f in glob.glob(path+&amp;#39;/*&amp;#39;):
    x=f.split(&amp;#39;\\&amp;#39;)[1]
    res = x.translate(None, digits).split(&amp;#39;.&amp;#39;)[0].split(&amp;#39;_&amp;#39;)[0]
    arr1.append(res)
    str1+=&amp;#39;audio/&amp;#39;+x+&amp;#39;\t&amp;#39;+res+&amp;#39;\n&amp;#39;

file1 = open(&amp;quot;meta.txt&amp;quot;,&amp;quot;w&amp;quot;) 
file1.write(str1) 
file1.close()
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;This fetches all the files and puts them under the &lt;code&gt;meta.txt&lt;/code&gt; such that each file corresponds to their class labels.&lt;/p&gt;
&lt;h2&gt;3. Lets Code&lt;/h2&gt;
&lt;h3&gt;3.a. Feature Extraction&lt;/h3&gt;
&lt;p&gt;In case of Audio, we flatten the data and pass it to the layers. We need to encapsulate the statistics of sound and make our model learn faster. IN our case we are using various features such as:
- &lt;strong&gt;MEL filterbanks&lt;/strong&gt;: Create a Filterbank matrix to combine FFT bins into Mel-frequency bins. 
- &lt;strong&gt;CQT(Constant Q Transform)&lt;/strong&gt;: THe Constant-Q-Transform (CQT) is a time-frequency representation where the frequency bins are geometrically spaced and the so called Q-factors (ratios of the center frequencies to bandwidths) of all bins are equal.The CQT essentially a wavelet transform, which means that the frequency resolution is better for low frequencies and the time resolution is better for high frequencies.[4]
- &lt;strong&gt;LOG-MEL(Logarithm - mel)&lt;/strong&gt;: We take logarithm of the Filterbank matrix.
- &lt;strong&gt;LOG-MFCC(Logarithm - MFCC )&lt;/strong&gt;: A widely used metric for describing timbral characteristics based on the Mel scale. Implemented according to Huang [1], Davis [2], Grierson [3] and the librosa library.&lt;/p&gt;
&lt;h4&gt;3.a.i. CQT&lt;/h4&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="c1"&gt;#Define all features to be extracted&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;config&lt;/span&gt; &lt;span class="kn"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;cfg&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;cqt_lib&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;wav_fd&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;fe_fd&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;names&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="n"&gt;na&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;na&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;listdir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;wav_fd&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;na&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;endswith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;.wav&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;names&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;sorted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;names&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;na&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;names&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;wav_fd&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;/&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;na&lt;/span&gt;
        &lt;span class="n"&gt;wav&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sr&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;librosa&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;sr&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;44100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;cqt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;librosa&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;core&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cqt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;wav&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;out_path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fe_fd&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;/&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;na&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;.f&amp;#39;&lt;/span&gt;
        &lt;span class="n"&gt;cPickle&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dump&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;cqt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;out_path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;wb&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;protocol&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;cPickle&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;HIGHEST_PROTOCOL&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="vm"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;__main__&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
     &lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CreateFolder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Fe&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
     &lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CreateFolder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Fe/cqt&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
     &lt;span class="n"&gt;cqt_lib&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;wav_fd&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fe_cqt_fd&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;h3&gt;3.b. Simple DNN Model&lt;/h3&gt;
&lt;p&gt;We are going to make a simple dnn model and pass on certain parameters which are required for the model.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="c1"&gt;#Our files&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;config&lt;/span&gt; &lt;span class="kn"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;cfg&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;features&lt;/span&gt; &lt;span class="kn"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;F&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;apnahat&lt;/span&gt; &lt;span class="kn"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;H&lt;/span&gt;

&lt;span class="c1"&gt;#Python modules&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;time&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;csv&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;cPickle&lt;/span&gt;

&lt;span class="c1"&gt;#Data managing modules&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;matplotlib.pyplot&lt;/span&gt; &lt;span class="kn"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;plt&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;numpy&lt;/span&gt; &lt;span class="kn"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;np&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;sklearn.cross_validation&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;KFold&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;sklearn.metrics&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;classification_report&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;accuracy_score&lt;/span&gt;

&lt;span class="c1"&gt;#Deep Learning Modules&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;keras.models&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Sequential&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;keras.layers&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Dense&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;Dropout&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;keras.layers.advanced_activations&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;LeakyReLU&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;keras.utils&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;to_categorical&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Whenever we work with machine learning algorithms that use a stochastic process (e.g. random numbers), it is a good idea to set the random number seed.&lt;/p&gt;
&lt;p&gt;This is so that you can run the same code again and again and get the same result. 
You can initialize the random number generator with any seed you like      &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;seed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1234&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Each feature has a separate dimension, we are using cqt which returns features with dimension as 80.&lt;/p&gt;
&lt;p&gt;We set the parameters initially based on the feature.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;dimension1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;
&lt;span class="n"&gt;dimension2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dimension1&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;
&lt;span class="n"&gt;agg_num&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;
&lt;span class="n"&gt;hop&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;
&lt;span class="n"&gt;feature_text&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;cqt&amp;quot;&lt;/span&gt;
&lt;span class="n"&gt;fe_fd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fe_cqt_fd&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Feature&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;feature_text&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;We define all our &lt;code&gt;hyperparameters&lt;/code&gt;. Configuring neural networks is difficult because there is no good theory on how to do it.&lt;/p&gt;
&lt;p&gt;We must be systematic and explore different configurations and  understand what is going on for a given predictive modeling problem.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;input_neurons&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;
&lt;span class="n"&gt;dropout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.1&lt;/span&gt;
&lt;span class="n"&gt;act1&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;linear&amp;#39;&lt;/span&gt;
&lt;span class="n"&gt;act2&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;relu&amp;#39;&lt;/span&gt;
&lt;span class="n"&gt;act3&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;sigmoid&amp;#39;&lt;/span&gt;
&lt;span class="n"&gt;act4&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;softmax&amp;#39;&lt;/span&gt;
&lt;span class="n"&gt;epochs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;
&lt;span class="n"&gt;batchsize&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;
&lt;span class="n"&gt;num_classes&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;We now make a separate function for using the &lt;code&gt;meta&lt;/code&gt; file as a base for calling all the features of the &lt;strong&gt;audio&lt;/strong&gt; files. This function returns a 3d array as it comes in handy when handling Convolution Neural Networks. &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;GetAllData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fe_fd&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;csv_file&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;agg_num&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;hop&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# read csv&lt;/span&gt;
    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nb"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;csv_file&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;rb&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;reader&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;csv&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;reader&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;lis&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;reader&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# init list&lt;/span&gt;
    &lt;span class="n"&gt;X3d_all&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
    &lt;span class="n"&gt;y_all&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
    &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;li&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;lis&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="c1"&gt;# load data&lt;/span&gt;
        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;na&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lb&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;li&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&lt;/span&gt;&lt;span class="se"&gt;\t&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;na&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;na&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;/&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="n"&gt;path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fe_fd&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;/&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;na&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;.f&amp;#39;&lt;/span&gt;
        &lt;span class="c1"&gt;#i+=1&lt;/span&gt;
        &lt;span class="c1"&gt;#print i&lt;/span&gt;
        &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;X&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cPickle&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nb"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;rb&amp;#39;&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="ne"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;Error while parsing&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;
            &lt;span class="k"&gt;continue&lt;/span&gt;
        &lt;span class="c1"&gt;# reshape data to (n_block, n_time, n_freq)&lt;/span&gt;
        &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;+=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Files Loaded&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;
        &lt;span class="n"&gt;X3d&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;H&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mat_2d_to_3d&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;X&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;agg_num&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;hop&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;X3d_all&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;X3d&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;y_all&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;lb_to_id&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;lb&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;X3d&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;All files loaded successfully&amp;#39;&lt;/span&gt;
    &lt;span class="c1"&gt;# concatenate list to array&lt;/span&gt;
    &lt;span class="n"&gt;X3d_all&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;concatenate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;X3d_all&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;y_all&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;y_all&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;X3d_all&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y_all&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;We call the function to return a 3d array of train X and  1d array of train Y. We now reshape our 3d array into 1d.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;tr_X&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tr_y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;GetAllData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;fe_fd&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;meta_csv&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;agg_num&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;hop&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;tr_X&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;tr_X&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;reshape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tr_X&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;shape&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="n"&gt;tr_X&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;shape&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;tr_X&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;shape&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Altering the feature arrays&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;We are using a single function from the &lt;a href="https://github.com/qiuqiangkong/Hat"&gt;hat&lt;/a&gt; module. We are going to make a separate model for that and call it &lt;strong&gt;&lt;em&gt;apnahat.py&lt;/em&gt;&lt;/strong&gt;. The function takes a 2d array as input and returns a 3d array. We shall be using this to pass into our model.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;numpy&lt;/span&gt; &lt;span class="kn"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;np&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;mat_2d_to_3d&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;X&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;agg_num&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;hop&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# pad to at least one block&lt;/span&gt;
    &lt;span class="n"&gt;len_X&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n_in&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;X&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;shape&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len_X&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;agg_num&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;X&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;concatenate&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;X&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;zeros&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;agg_num&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;len_X&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n_in&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
    &lt;span class="c1"&gt;# agg 2d to 3d&lt;/span&gt;
    &lt;span class="n"&gt;len_X&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;X&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;i1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="n"&gt;X3d&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i1&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;agg_num&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;len_X&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;X3d&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;X&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;i1&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;agg_num&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
        &lt;span class="n"&gt;i1&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;hop&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;X3d&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;h4&gt;3.b.ii. The DNN Model&lt;/h4&gt;
&lt;p&gt;We are now going to make a function for our model which returns a compiled model.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;prepare_model&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Sequential&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Dense&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input_neurons&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;input_dim&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dimension2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;activation&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;act1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="n"&gt;lr&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;LeakyReLU&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;alpha&lt;/span&gt;&lt;span class="o"&gt;=.&lt;/span&gt;&lt;span class="mo"&gt;001&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Dropout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dropout&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Dense&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input_neurons&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;activation&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;act2&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Dropout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dropout&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Dense&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input_neurons&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;activation&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;act3&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Dropout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dropout&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Dense&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num_classes&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;activation&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;act4&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;compile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;loss&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;categorical_crossentropy&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                  &lt;span class="n"&gt;optimizer&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;adam&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                  &lt;span class="n"&gt;metrics&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;accuracy&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;We are going to implement cross-validation. In our case, we are going to do a 10-fold cross-validation.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;kf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;KFold&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tr_X&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;shuffle&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;random_state&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;results&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;    
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;train_indices&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;test_indices&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;kf&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;train_x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;tr_X&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ii&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;ii&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;train_indices&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;train_y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;tr_y&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ii&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;ii&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;train_indices&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;test_x&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;tr_X&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ii&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;ii&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;test_indices&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;test_y&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;tr_y&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ii&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;ii&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;test_indices&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;train_y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;to_categorical&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;train_y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;num_classes&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;test_y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;to_categorical&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;test_y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;num_classes&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 

    &lt;span class="n"&gt;train_x&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;train_x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;train_y&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;train_y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;test_x&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;test_x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;test_y&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;test_y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;All arrays loaded&amp;quot;&lt;/span&gt;

    &lt;span class="c1"&gt;#get compiled model&lt;/span&gt;
    &lt;span class="n"&gt;lrmodel&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;prepare_model&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="c1"&gt;#see the model&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="n"&gt;lrmodel&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;summary&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="c1"&gt;#fit the model&lt;/span&gt;
    &lt;span class="n"&gt;lrmodel&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;train_x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;train_y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;batch_size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;batchsize&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;epochs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;epochs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;verbose&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;#make prediction&lt;/span&gt;
    &lt;span class="n"&gt;pred&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;lrmodel&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;predict&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;test_x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;batch_size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;verbose&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;pred&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ii&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;argmax&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;ii&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;pred&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;test_y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ii&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;argmax&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;ii&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;test_y&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

    &lt;span class="n"&gt;results&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;accuracy_score&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pred&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;test_y&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="n"&gt;accuracy_score&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pred&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;test_y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;jj&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;test_y&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Unique in test_y&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;jj&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Results: &amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;results&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="n"&gt;classification_report&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;test_y&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="n"&gt;pred&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;h2&gt;4. References&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;X. Huang, A. Acero, and H.-W. Hon, Spoken Language Processing: A Guide to Theory, Algorithm, and System Development. Upper Saddle River, NJ, USA: Prentice Hall PTR, 1st ed., 2001.&lt;/li&gt;
&lt;li&gt;S. Davis and P. Mermelstein, “Comparison of parametric representations for monosyllabic word recognition in continuously spoken sentences,” Acoustics, Speech and Signal Processing, IEEE Transactions on, vol. 28, pp. 357–366, Aug 1980.&lt;/li&gt;
&lt;li&gt;M. Grierson, “Maximilian: A cross platform c++ audio synthesis library for artists learning to program.,” in Proceedings of International Computer Music Conference, 2010.&lt;/li&gt;
&lt;li&gt;lidy2016cqt,"CQT-based convolutional neural networks for audio scene classification and domestic audio tagging," in IEEE AASP Challenge on Detection and Classification of Acoustic Scenes and Events (DCASE 2016), Budapest, Hungary, Tech. Rep, 2016.&lt;/li&gt;
&lt;/ol&gt;</summary><category term="DNN"></category><category term="Audio"></category></entry><entry><title>Floydhub Documentation</title><link href="/floydhub-documentation.html" rel="alternate"></link><published>2018-04-17T00:00:00+05:30</published><updated>2018-04-17T00:00:00+05:30</updated><author><name>Aditya Arora, Akshita Gupta</name></author><id>tag:,2017-08-20:floydhub-documentation.html</id><summary type="html">&lt;h6&gt;&lt;/h6&gt;
&lt;p&gt;Floyd is a great cloud computing platform.I have used it for running a lot of my deep learning models. The main advantage of using Floyd is that you don't require a &lt;strong&gt;Credit Card&lt;/strong&gt; and that is the main reason for giving a try to Floyd. &lt;/p&gt;
&lt;p&gt;Floyd has a pretty handy &lt;em&gt;documentation&lt;/em&gt; at
&lt;a href="http://docs.floydhub.com/" title="Floyd's Documentation"&gt;Floydhub&lt;/a&gt; which is updated at regular intervals.&lt;/p&gt;
&lt;p&gt;Initiallly I wrote this blog when there were a lot of confusions but now it is a very crisp and easy to use docs page.
This post contains steps to Get up and running with Floyd on Windows.&lt;/p&gt;
&lt;h2&gt;Python Machine Learning Setting up Floyd&lt;/h2&gt;
&lt;p&gt;Setting up floyd for using on Windows.&lt;/p&gt;
&lt;h3&gt;Account&lt;/h3&gt;
&lt;p&gt;Make your account at
&lt;a href="https://www.floydhub.com/" title="Floyd's Homepage"&gt;Floydhub&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You can get a free account which gives 10GB of storage and 20 hours of CPU time.
You can upgrade to any of their paid plans if you want to use their GPU and continue using their services.&lt;/p&gt;
&lt;h3&gt;Installation&lt;/h3&gt;
&lt;p&gt;Install the &lt;code&gt;floyd-cli&lt;/code&gt; using&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;$ pip install -U floyd-cli
&lt;/pre&gt;&lt;/div&gt;


&lt;h3&gt;Login&lt;/h3&gt;
&lt;p&gt;Make sure you are logged in to your browser before continuing with this step.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;$ floyd login
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Copy and paste your authentication token in your terminal&lt;/p&gt;
&lt;h2&gt;Run project&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Make a project folder&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;$ mkdir myproject
&lt;/pre&gt;&lt;/div&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Change to project folder&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;$ &lt;span class="nb"&gt;cd&lt;/span&gt; myproject
&lt;/pre&gt;&lt;/div&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Make a folder for data&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;$ mkdir &amp;lt;mydata&amp;gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Make a folder for code&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;$ mkdir &amp;lt;mycode&amp;gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Paste all your data in &lt;code&gt;&amp;lt;mydata&amp;gt;&lt;/code&gt; and your code in &lt;code&gt;&amp;lt;mycode&amp;gt;&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Change to data directory&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;$ &lt;span class="nb"&gt;cd&lt;/span&gt; &amp;lt;mydata&amp;gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Initialise data&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;$ floyd data init sent-data
&lt;/pre&gt;&lt;/div&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Upload your dataset to Floyd&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;$ floyd data upload
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Floyd will generate a data id for the uploaded dataset. This uploaded dataset can be used in your future experiments, if needed, using this data id.
&lt;br /&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;Creating data source. Uploading files ...
DATA ID                 NAME                    VERSION
----------------------  --------------------  ---------
GY3QRFFUA8KpbnqvroTPPW  alice/sent-data:1            1
&lt;/pre&gt;&lt;/div&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Change to the code directory&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;$ &lt;span class="nb"&gt;cd&lt;/span&gt; ../mycode
&lt;/pre&gt;&lt;/div&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Run the code&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;$ floyd run --data &amp;lt;DATA_KEY&amp;gt;:&amp;lt;MOUNT&amp;gt; --env theano-0.9:py2 &lt;span class="s2"&gt;&amp;quot;python filename.py&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;This would run the code in the cloud.&lt;br /&gt;&lt;strong&gt;Example code&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;$ floyd run --data GY3QRFFUA8KpbnqvroTPPW:mydata --env theano-0.9:py2 &lt;span class="s2"&gt;&amp;quot;python mlp.py&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Check the status of code&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;$ floyd logs &amp;lt;RUN_ID&amp;gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Some common problems:&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Should I put my code and data in separate folders&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Adding the codes in a separate folder prevents re-loading of data in the memory of floyd server.
Floyd server synchronizes the WHOLE FOLDER in which the code is located when you run the code using the above command, which is actually a waste of (upload) time and a problem of data redundancy as you have already uploaded the data on the server.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How to link data in my script&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;x_data = np.load(&amp;#39;/nfiles/fileone.npy&amp;#39;)
y_data = np.load(&amp;#39;/nfiles/filetwo.npy&amp;#39;)
&lt;/pre&gt;&lt;/div&gt;


&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here, nfiles is my MOUNT point.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If you are using Anaconda prompt and you come across the following error after running the command: "pip install -U floyd-cli": scandir could not be installed&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;$ conda install -c conda-forge &lt;span class="nv"&gt;scandir&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;.5
&lt;/pre&gt;&lt;/div&gt;


&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you have any issues kindly raise an issue in the &lt;a href="https://github.com/channelCS/channelcs.github.io"&gt;GitHub&lt;/a&gt; repo.&lt;/p&gt;</summary><category term="floyd"></category></entry></feed>