I took all of these at once around 9:30 pm. I had gotten 3 hours of sleep the night before and forced myself to stay awake all day because Iíve been wanting to wake up in the morning. About 2 hours before I went to bed I ate a bit of orange chicken and fried rice along with a half a cup of this nasty sugar fried Caribu Coffee.
I've been taking 100mg 5-htp regularly now to help both with sleep and depression. and I have noticed some subtle effects with absolutely no side effects the next morning. But usually a case of gut rut or so for most of the day, which is easily cured with a healthy breakfast and some green tea. I have read that 5-htp, depending on how much exposure to sunlight and darker areas I have, releases both serotonin and melatonin, however Iím not sure which it produces more of.
Melatonin Iíve been taking on and off for a while. These tablets I have now come with several small white pills with 3mg melatonin and 10mg b6 per one dosage tablet. Now. Iím not entirely sure weather melatonin actually does everything I read it did. By taking at the right time before bed, with the right dosage, it is said to 'quite easily help the body adjust to healthy sleeping patters with sound sleep and little or no side effects come morning time, and a typical dose being anywhere from 3-10mg'.
In my previous experiences with taking this much melatonin (most of the time without 5-htp) I felt very groggy the next morning, a side effect compared to smoking heavy amounts of cannabis the night before, and usually lasting the better part of the day. I then cut the dose down to 1.5-2 grams and rarely noticed any adverse side effects come morning, and falling asleep was usually easier. Vivid dreams also were usually accompanied by taking any noticeable dosage of melatonin, but does not have any effect on being able to remember my dreams come morning time (and I have a huge problem with that most of the time, unless I awoke in the middle of a dream).
This time with melatonin, it was the same as every other time really, and Iím not sure if any of the side effects were intensified due to the 5-htp and or the caffeine I took the night before.
T+0:00
An hour after ingestion I started to feel very relaxed and distant, sort of disconnected with my body (tripping over things a little more, zoning out etc). I then went to sleep due to the overwhelming drowsiness I felt. I have had a long history of sleep disorders and irregular sleep patterns that have not been diagnosed by any doctor what so ever.  I recall waking up at least 5 times throughout the entire night, which I believe is a typical thing for me to do. But the first time I woke up it wasnít until about 2am. After that it was every 1-2 hours until I finally decided to get up at 7am. I faintly recall having scattered, weird, vivid dreams, but I do not remember them at all.
T+9:30
And I feel extremely groggy, shitty, disconnected, the empty gut rut stomach feeling, and sort of a thin white haze over everything. near emotionless and not passionate whatsoever. these are typical symptoms for me when I wake up in the morning, but it is definitely more intensified with use of the melatonin. I have sort of bad allergies as well, and almost every morning I wake up with clogged sinus's and a headache. And I understand that may be more than allergies. Iím going to go drink some tea, eat some breakfast, meditate and see if the side effects dissolve.
T+11:30
Feeling much better after eating and taking vitamins, but I still feel some lingering effects, sorta spacey.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Green - Ok
Normal
Working
Multi-Step
Sizes with trailing label
xSmall
Small
Medium
Large
xLarge
Sizes - Working
xSmall
Small
Medium
Large
xLarge
Orange - Processing
Normal
Working
Multi-Step
Sizes with trailing label
xSmall
Small
Medium
Large
xLarge
Sizes - Working
xSmall
Small
Medium
Large
xLarge
Red - Error
Normal
Working
Multi-Step
Sizes with trailing label
xSmall
Small
Medium
Large
xLarge
Sizes - Working
xSmall
Small
Medium
Large
xLarge
Blue - Neutral
Normal
Working
Multi-Step
Sizes with trailing label
xSmall
Small
Medium
Large
xLarge
Sizes - Working
xSmall
Small
Medium
Large
xLarge


Awesome Test
This is a test file
XML
Libraries and tools for manipulating XML.
- xpath - XPath package for Go.
- invalid - This is a GitHub repository, but not link home page.
- invalid - A non-existent repository.
OpenGL
Libraries for using OpenGL in Go.
- go-glmatrix - Go port of glMatrix library.
- goxjs/glfw - Go cross-platform glfw library for creating an OpenGL context and receiving events.
- invalid - Not a valid project, only for test.
Empty
Empty list
Empty
Empty list


--- layout: post title: 一些值得记录的Python笔记 categories: computers tags: Python excerpt: A compilation of notes related to Python ---
simple usage is like:
>>> f=itemgetter(2) >>> l=(1,2,3) >>> f(l) 3
It's very useful when applied to sorting, e.g.,
## sorting students by weight (suppose student has attr. student.weight) sorted(students, key=attrgetter('weight')
if (module.__class__.__name__==unicode)
Update: it's better to use a classmethod. See the next note.
classmethod receives the class it's called on as the first argument (as cls); regular instance method gets the instance it's called on as the first argument (as self); staticmethod gets either of them.
classmethos is useful for alternative constructors.
a = [1,2] b = [1,2] a == b # returns True a is b # returns False
==
checks the value, while is
checks the object itself. See this SO thread
http://stackoverflow.com/questions/132988/is-there-a-difference-between-and-is-in-python
.
in regex doesn't match newline (\s
matches newline)
pip install -i http://pypi.douban.com/simple/ gevent


| CLEAR |
= |
"\e[0m" |
|
Embed in a String to clear all previous ANSI sequences.
|
| BOLD |
= |
"\e[1m" |
|
The start of an ANSI bold sequence.
|
| BLACK |
= |
"\e[30m" |
|
Set the terminal‘s foreground ANSI color to black.
|
| RED |
= |
"\e[31m" |
|
Set the terminal‘s foreground ANSI color to red.
|
| GREEN |
= |
"\e[32m" |
|
Set the terminal‘s foreground ANSI color to green.
|
| YELLOW |
= |
"\e[33m" |
|
Set the terminal‘s foreground ANSI color to yellow.
|
| BLUE |
= |
"\e[34m" |
|
Set the terminal‘s foreground ANSI color to blue.
|
| MAGENTA |
= |
"\e[35m" |
|
Set the terminal‘s foreground ANSI color to magenta.
|
| CYAN |
= |
"\e[36m" |
|
Set the terminal‘s foreground ANSI color to cyan.
|
| WHITE |
= |
"\e[37m" |
|
Set the terminal‘s foreground ANSI color to white.
|
| ON_BLACK |
= |
"\e[40m" |
|
Set the terminal‘s background ANSI color to black.
|
| ON_RED |
= |
"\e[41m" |
|
Set the terminal‘s background ANSI color to red.
|
| ON_GREEN |
= |
"\e[42m" |
|
Set the terminal‘s background ANSI color to green.
|
| ON_YELLOW |
= |
"\e[43m" |
|
Set the terminal‘s background ANSI color to yellow.
|
| ON_BLUE |
= |
"\e[44m" |
|
Set the terminal‘s background ANSI color to blue.
|
| ON_MAGENTA |
= |
"\e[45m" |
|
Set the terminal‘s background ANSI color to magenta.
|
| ON_CYAN |
= |
"\e[46m" |
|
Set the terminal‘s background ANSI color to cyan.
|
| ON_WHITE |
= |
"\e[47m" |
|
Set the terminal‘s background ANSI color to white.
|


Extension Loot - known as xLoot - is a collection of 7,777 unique bags of adventurer gear that extends the original idea of Loot. xLoot was released by Colin Platt (@colingplatt). xLoot is an extension of the idea started with Loot - an open and free to mint NFT bag of gear for adventurers. Each xLoot bag contains 8 items: a piece for an adventurer's chest, foot, hand, head, neck, ring, waist, and weapon. xLoot is more than just an NFT project, its a community. It requires the community to build onto it in an bottom-up fashion, creating a decentralized metaverse all tied together through NFT ownership.
No - both Loot and xLoot are fully decentralized, community owned and driven projects. There is no official team for Loot or xLoot. The original developers do not have any obligation to add-on or grow the project in any way. Loot was designed to be an open-source NFT toolkit or blueprint, to be iterated on and implemented in projects by the community, not by a core team. xLoot's author, Colin, loved the original Loot concept but wanted to make the project accessible to more people so he created xLoot. xLoot respects the original Loot thesis and also the original Token ID's of Loot, so it was not just a simple clone. The xLoot community today is a thriving hub of talent and innovation. Our community is bringing together, artists, writers, developers and projects managers to create amazing products or projects that are based on the xLoot NFT's - driving more value to those who hold xLoot bags.
xLoot is designed as a foundation for a community governed, bottom-up, decentralized metaverse. Projects that implement xLoot NFTs and the community around these projects is what ultimately drives its value.
Anything you want! Just like Loot, xLoot was launched with no defined rarity, stats, visual assets or additional functionality. Feel free to use xLoot in any way that you want. Check out what our community is building under Resources.
Items do have varying levels of how often they occur in the series of xLoot bags, but true rarity is determined by the community and the way xLoot is implemented in other projects. An example that carried over from the Loot community was that Divine Robes and Katanas were more highly valued than other items, but that can change at any point depending on the community's sentiment. You can learn more about occurences and raritie calculations in our Resources.


Just Trivia
A simple trivia website made using the opentdb.com API.
Select categories to filter the new question search. If you're stuck, try using a hint.
Categories
Hint
Show Answer
New Question
Category:
Difficulty:
Hint:


Cycle Speed:
1
Jump Range:
10
Population:
1000
Pipe Spacing:
150
FPS Optimizer:
Off
Current Score: 0
High Score: 0
Generation: 1


Vegan Galaxy bars are about to go on sale in the UK in three tasty flavours
Galaxy is set to release a trio of plant-based vegan chocolate bars that will be sold at Tesco, Amazon and Ocado
by Melisha Kaur, https://www.mirror.co.uk/authors/melisha-kaur/If you're a vegan and love chocolate , getting your fix is about to become a whole lot easier.
Mars is set to launch a range of vegan Galaxy chocolate bars for the first time in the UK - and they sound delicious.
The new plant-based versions of Galaxy's best-selling chocolate bars will be available in three flavours: Smooth Orange, Caramel & Sea Salt, and Caramelized Hazelnut.
They are going on sale at Tesco supermarkets nationwide from Monday, November 18 and then online at Ocado and Amazon .
Shoppers can pick up the 100g vegan chocolate bars for £3 each - which is double the price of the original Galaxy (£1, Tesco ).
Mars, which is Britain's second-largest confectionery brand, claims it has spent over six months reformulating its cult chocolate bar.
The new plant-based recipe replaces dairy with hazelnut paste and rice syrup.
Not only are these tempting bars vegan-friendly, but also come in eco-friendly packaging made of card and compostable film.
Kerry Cavanaugh, marketing director at Galaxy manufacturer Mars Wrigley UK, said: “Wherever you look you can’t avoid the vegan buzz in the UK and with the launch of Galaxy Vegan we’re thrilled to be offering vegans, flexitarians and lovers of sweet treats even more ways to choose pleasure with a brand they love.”
Meanwhile, Mr Kipling recently launched Irish Creme Fancies for Christmas that are sold at Tesco and Iceland.
Looking for advent calendars? Browse our roundup of the best Christmas chocolate advent calendars for 2019 .


If you love Telegram but don't want to leave Discord then you'll be pleased to find we've built a bridge in this channel. If you'd like to join the group in the Telegram app you can find it here: https://t.me/KomodoPlatform_Official.
100 messages
Before 05-Dec-19 12:00 AM
GatewayBOT04-Jun-19 12:54 AM
[telegram] <cmyslopez> This is way more bigger than just a simple payment system. You are looking at the little dot in the bigger picture. (re @Pmim: Hi...please explain more ur new announcement regarding web application hosted on AWS marketplace. Will amazon use kmd as their payment system?)
GatewayBOT04-Jun-19 01:11 AM
[telegram] <Pmim> Please explain more Camilo (re @cmyslopez: This is way more bigger than just a simple payment system. You are looking at the little dot in the bigger picture.)
The Next Step In Building An Open, Programmable And Interoperable Multi-Chain Ecosystem
[telegram] <yorklab> Officially Komodo is an Advanced Technology Partner with AWS. (re @Pmim: Hi...please explain more ur new announcement regarding web application hosted on AWS marketplace. Will amazon use kmd as their payment system?)
The Next Step In Building An Open, Programmable And Interoperable Multi-Chain Ecosystem
[telegram] <Pmim> Thanks Yorklab. Btw, why do u use komodo as ur company's name? Indonesian company? (re @yorklab: Officially Komodo is an Advanced Technology Partner with AWS.)
[telegram] <yorklab> There is a story behind that but can't recall now.
[telegram] <Pmim> Oh okay. Maybe like pundi x. Pundi x is not indonesian company but the founder is half indonesia. That's why he use pundi as his company name. Pundi means wallet (re @yorklab: There is a story behind that but can't recall now.)
GatewayBOT04-Jun-19 02:36 AM
[telegram] <Instel7> JL777 is obviously Satoshi (re @yorklab: Scroll down and read through that web site above. Many modules are now ready to go; here is one example:
"Quantum Security:
This module adds the Dilithium digital signature scheme to your blockchain, making all transactions quantum secure.")
GatewayBOT04-Jun-19 03:18 AM
[telegram] <simonlin1> Hello,admin，I got a free listing offer to share,PM me for the details if interested,thanks.
GatewayBOT04-Jun-19 05:40 AM
[telegram] <Acura360> Pinned message updated
GatewayBOT04-Jun-19 06:59 AM
[telegram] <Acura360> Komodo Is Introducing Antara, An End-To-End Smart Chain Development Framework
The Next Step In Building An Open, Programmable And Interoperable Multi-Chain Ecosystem
Komodo technology has been rapidly evolving during the past years and we are no longer the same project. We have launched an 'evolution campaign' to start introducing the new Komodo terminology and product offerings.
Learn more: https://evolve.komodoplatform.com/
The Next Step In Building An Open, Programmable And Interoperable Multi-Chain Ecosystem
GatewayBOT04-Jun-19 08:08 AM
[telegram] <Rachel> hey
GatewayBOT04-Jun-19 08:16 AM
[telegram] <Hastrup> Hey
[telegram] <drcliffc> Hey I am a cardano ambassador. I tried to contact kmd last year. Had some chats with jl. Anyway can we get cardano on kmd?
GatewayBOT04-Jun-19 08:24 AM
[telegram] <Acura360> You mean dPow on Cardano ? (re @drcliffc: Hey I am a cardano ambassador. I tried to contact kmd last year. Had some chats with jl. Anyway can we get cardano on kmd?)
[telegram] <drcliffc> Pos
[telegram] <Acura360> Best way is to come in our Discord
[telegram] <Acura360> to discuss that
[telegram] <drcliffc> OK. I will get back on that.
We are absolutely delighted to announce the listing of $RFOX on @Liquid_Global $RFOX trading pairs include $BTC and $ETH
https://t.co/4dXFns5O2I
GatewayBOT04-Jun-19 10:44 AM
[telegram] <Debodebeli> If Antara is independent ecosystem what is benefit of kmd holders from antara?
Can i get simple explain please?
[telegram] <Iv> Непопулярность А. Голубева среди населения, уже как естественное, но как отмечает его же окружение, слово ,,непопулярность,, преобразовалась в более жёсткие слова и связано это с различными скандалами в соцсфере из – за поступков и отношения Голубева к населению.
Что только стоит неуважительное отношение к ветеранам интернациалистам со стороны А. Голубева, о котором стало известно на федеральным уровне.
Никакой самовар с бубликами не поможет расположить людей в военной форме к главе админситрации Сарова, поскольку кредит доверия отсутствует и даже если их начать подогревать деньгами, расположение уже не вернуть (его и не было).
От Кардинала:
Если ваш кофе остыл, не стоит его подогревать, вкусным он уже не будет. С людьми так же...
we see it with PIRATE, where as it does well, people take profits and move it into KMD
as any ecosystem coin does well, odds are very good that people in the ecosystem are doing well
and the coin at the center of the ecosystem is?
KMD
via KMD you can go to PIRATE or VRSC or any other
and there is also the 5% per year, which by itself makes it on a pretty short list of the top 50 coins
people forget that in open source, if you charge fees that are too high, then people will just fork it
so you cant really charge more than the minimal fees, which means forcing artificial demand will just be a short term effect
we are after a long term permanent effect
of hundreds of high quality projects in the ecosystem
none of them obligated to pay a KMD tax, but where KMD is the path of least resistance
many ecosystem projects on their own decide to help promote KMD, and during the high growth phase what is the most important, if it isnt awareness
or we could charge a big huge KMD tax and get little to no adoption, but maybe it looks good on paper for those that dont understand the elasticity of demand based on higher prices
maybe you believe that BTC txfees being $100 is a good thing?
GatewayBOT04-Jun-19 11:56 AM
[telegram] <Regnar> Antara is the brand name of the framework and tools. Much like how different software companies name their software kits and products. Komodo uses Antara tools, Smart Chains use Antara tools. Antara isn't a separate ecosystem, it's the name of the tools offered in the Komodo ecosystem (re @Debodebeli: If Antara is independent ecosystem what is benefit of kmd holders from antara?
Can i get simple explain please?)
jl777c04-Jun-19 11:57 AM
there is a video somewhere about antara, does that not explain clearly?
Komodo technology has been rapidly evolving during the past years and we are no longer the same project. We have launched an 'evolution campaign' to start in...
it is a bit more than one minute long. let me know if it is still unclear
GatewayBOT04-Jun-19 11:59 AM
[telegram] <JohDio> I think that’s a really valid argument, considering the overall race
To becoming a big ecosystem. The lower fees will play an importan part. (re @Matterbridge_kmdbot: [discord] <jl777c> people forget that in open source, if you charge fees that are too high, then people will just fork it)
jl777c04-Jun-19 12:04 PM
how were people feeling about paying $5 per ETH transaction?
and more to run the dapp?
what is the first reaction when you end up overpaying for something?
to say, "hey this was great, lets do it again and again"?
or, "let me figure out as quick as possible how not to pay such crazy fees"
granted things that dont get much usage, wont care too much about such things
GatewayBOT04-Jun-19 12:06 PM
[telegram] <E> Cup and handle or inverted h and s in process. Komodo will fly now
jl777c04-Jun-19 12:07 PM
so i expect that projects that dont get much usage would just use ETH and other high tax platforms, but projects that will get a lot of usage will want to be independent. and why reinvent the wheel, the engine, the transmission, the brake system, ... if you can just use antara to jumpstart your project and be as independent as if you spent 5 years developing the same thing?
and imagine more than one successful project in the komodo ecosystem.
there wont be a 1:1 spillover, but even if just a small percentage spills over, KMD benefits
and there is always the 5% per year no matter what
so maybe KMD is the more stable price in the ecosystem as compared to the new projects, especially if they are starting from a low marketcap
GatewayBOT04-Jun-19 12:08 PM
[telegram] <E> Very promising milestone. Shall open doors to next level
jl777c04-Jun-19 12:09 PM
but with trading pairs all against KMD, KMD becomes the preferred coin to park funds in, especially since when using atomicDEX you can still collect the 5%
what is unclear to me is why it is not clear to people that 0% komodo tax rate is the optimal for maximum ecosystem growth
GatewayBOT04-Jun-19 12:13 PM
[telegram] <Mike> Well said boss
jl777c04-Jun-19 12:21 PM
if you are a high wage earner, would you prefer to live in a country (all else being equal) with a 50% tax on earnings or 0% tax?
and now we have a lot of high wage earners all in the same ecosystem, who will then come up with more ideas
and there will be goodwill toward komodo
over years, this goodwill is something that becomes very valuable and impossible to obtain in any other way
GatewayBOT04-Jun-19 12:47 PM
[telegram] <H0DL3R> Hello can anyone tell me which is best wallet for getting interest? I had komodo in ledger over the last year, is any way to claim interest without exposing security? I cant find updated info. Thanks in advance
[telegram] <gigaho> Do you need to use the KMD token to transact on the future Dex?
jl777c04-Jun-19 01:04 PM
no
a 2 coin swap should only require 2 coins
and each side just needs the coin they are trading
GatewayBOT04-Jun-19 01:05 PM
[telegram] <gigaho> What is the benefit to owning the token
[telegram] <gigaho> KMD
jl777c04-Jun-19 01:06 PM
read above
GatewayBOT04-Jun-19 01:06 PM
[telegram] <gigaho> Pinned?
jl777c04-Jun-19 01:06 PM
a few pages above
GatewayBOT04-Jun-19 01:18 PM
[telegram] <gigaho> Thanks buddy
[telegram] <gigaho> I remember talking with some of the guys on btch or whatever it was. Very smart guys and quick to respond. Much appreciate you have stayed the same way
[telegram] <gigaho> (assuming some of the same people)
GatewayBOT04-Jun-19 01:43 PM
[telegram] <Tran> kmd to the moon
[telegram] <Tran> 37000sts
[telegram] <Jaime_Meneguele> 54000 sts
GatewayBOT04-Jun-19 02:19 PM
[telegram] <I3hARGAV> Thanks JL777... M not a techie.. But i love reading your posts.... i have been learning abt KMD for last 18 months.. M loving each and every update that you come up with..
GatewayBOT04-Jun-19 02:41 PM
[telegram] <icantgiveyou> I downloaded agama v0.3.6 beta and it says unfinished version on your own risk I never seen that before?


--- layout: post authors: ["Noam Ross"] title: "Managing GitHub Notifications" date: 2015-02-20 time: "14:00:00" tags: ["Tooling"] ---
SWC has many GitHub repositories for lessons, websites, and workshops, and we have many conversations about our work take place through GitHub issue threads. Since GitHub creates e-mail notifications of repositories and issues you participate in, that means you can quickly start getting loads of e-mail.
While it's helpful to be kept abreast of developments on a project, if you get a flood of GitHub messages you won't see what's important. Here's a quick primer on fine-tuning your notifications so that you only see what you want, gleaned from this helpful conversation:
You can "Watch" or "Unwatch" any GitHub repository, meaning you will get notifications from ALL discussions. This is a good idea for a repository that you are doing a lot of work on.
Click at the top of a repository page to watch it. Go to https://github.com/watching to see what you are currently watching and unsubscribe from things you don't care about.
If you are given push access to a repository, you'll automatically watch it. You can turn this off by unchecking "Automatic Watching" at https://github.com/settings/notifications so you're not signed up to watch stuff just because you've been given access to the git repo.
You are automatically "subscribed" to any issue thread that you start, comment on, or that someone @mentions you in, even in unwatched repositories. This is useful but can get tedious if a conversation continues past your interest. You can unsubscribe from any of these threads by hitting the button on the right of that issue thread. You can do this as soon as you comment on an issue that you don't want to keep talking about.
Alternatively, you can filter your notifications at your e-mail client, instead. Both Gmail and Google Inbox have automated categories/bundles that filter GitHub notifications away from your primary mail, or you can set filters manually to filter<EMAIL_ADDRESS>Those who manage e-mail through self-hosted/command line tools may be interested in Notmuch.
If you go this route, and you're a member of the SWC GitHub organization, you can filter mail from SWC repositories using "Custom Routing" under https://github.com/settings/notifications. This lets you direct notifications from the SWC organization to a custom email address. For Gmail, you can take advantage of the ability to add whatever you want to your email with a "+", and send SWC mail to<EMAIL_ADDRESS>for filtering.


--- layout: post authors: ["Greg Wilson"] title: "What is a Research Software Engineer?" date: 2015-06-29 time: "08:00:00" tags: ["Community"] ---
By now, many people in the UK (well, many of the sort who read this blog) will have heard the term Research Software Engineer, but what exactly is an RSE, and what effect will the creation of this title have? To understand, we need to go back to the Software Sustainability Institute's Collaborations Workshop in early 2012 (summarized in these blog posts and others). Those discussions led to this position paper at Digital Research 2012, whose authors argued that:
Research institutions need individuals with a new professional designation—the research software engineer. These individuals combine a professional attitude to the exercise of software engineering with a deep understanding of research topics. They lead the design and construction of increasingly complex research software systems, and play an important part in the co-design of research requirements, understanding and addressing software engineering questions that arise in research planning.
The importance of recognizing this role is hard to understand if you've never worked inside a large system, and hard to overstate if you have. Far too many of the people who build the complex software that scientists rely on live from one grant to the next, and constantly have to re-explain to the new chair or dean what exactly they do. They are as important to research as the people who design orbiting telescopes and electron microscopes, but because software is intangible, they are rarely recognized in the same way.
We can't afford this any longer: as demand for their skills outside academia keeps growing, it is becoming harder each year to retain the people without whom modern science would grind to a halt. And while naming and recognizing their career path won't magically make stable funding appear, it will certainly help.
The campaign to get the RSE role recognized quickly gathered steam. Simon Hettrick led work on the topic for the Software Sustainability Institute, which resulted in coverage in the Times Higher Educational Supplement in the summer of 2013, and brought together a group of leading RSEs who ultimately set up the UK RSE Association. The concept of a national organisation was first discussed at the fringes of the 2013 Digital Research meeting, was tested on the community at a workshop in 2013 and started life proper in 2014 with the first Annual General Meeting of a UK Association for RSEs.
This group lobbied the key players at the UK research councils, where people like Susan Morrell and her team embedded a call into the UK's ARCHER national HPC infrastructure proposal and the EPSRC's "Software for the Future" calls. At a recent research councils' "future of e-infrastructure" meeting it was clear that the whole community now recognises that funding software is at least as important as hardware, and EPSRC recently announced a call for an RSE fellowship program to help people found RSE groups.
Many Software Carpentry instructors are RSEs, even if they're not yet called that. As the term and the role become more widely accepted in the UK, we hope that the idea will also catch on elsewhere so that people who devote themselves to the kinds of things we teach will get the recognition we all need them to get. If you'd like to know more, please join their mailing list and help them grow.


Project-Glossary
- 2.4 Ghz
- The frequency used by digital (spread spectrum) radio communications in our applications, including 2.4Ghz RC, Bluetooth and some video transmission equipment. This is a different band than the older 72 Mhz band that is used for analog RC communications.
To avoid radio frequency conflict is it often a good idea to use 72 Mhz radio equipment when you are using 2.4 Ghz onboard video transmitters, or use 900 Mhz video when using 2.4 Ghz RC equipment.
- Accelerometer
- A device that measures the acceleration forces in a certain direction. These devices are used to stabilize quadcoptors, many times in windy conditions.
- Alert
- Call for Help. Comes in with a priority, and GPS location, when received a Alert ID
- Alert ID (AID)
- ID of an alert.
- Alert Systems
- Systems used to create and send alerts to the Mission Control
- Altitude (ALT)
- The vertical distance you are from ground.
- AMA
- Academy of Model Aeronautics. The main US model aircraft association. The AMA works closely with the Federal Aviation Administration (FAA) to establish reasonable rules for the use of amateur UAVs. Each AMA chapter and field may have slightly different
policies, but it’s possible to fly and test air frames and some technology on AMA fields without violating the association’s (or FAA/NAS) rules.
- Arducopter
- A flight controller firmware software.
- Barometric Pressure Sensor
- This device used barometric readings to determine the altitude of the aircraft. It can help drones to be able to calculate their height above the ground, along with using combinations of other sensors.
- BNF
- Bind N Fly. The unit is ready to bind to the transmitter and fly.
- Brushless Motor
- These motors have permanent magnets that rotate around a fixed armature, which eliminates any problems that could be associated with connecting current regarding a moving part. The brushless motors are much more efficient and hardy than brushed motors.
- Center of Gravity (CG)
- This is the point of balance of the unit. It needs to be maintained whenever you add various batteries, mounts, cameras or other accessories to the unit.
- Controller
- The handheld device that is used by the drone pilot that is used to control the drone and the quadcopter. Controllers are also called transmitters.
- Copter
- Rotary-wing autopilot software variant of the ArduPilot project.
- Drone
- An unmanned aircraft that is guided remotely by a pilot.
- Drone ID (DID)
- id of a drone
- Drone Run (DRun)
- scheduled run of a drone from leaving base to return
- DroneKit (DK)
- allows developers to create apps that run on an onboard companion computer and communicate with the ArduPilot flight controller using a low-latency link.
- Electronic Speed Control (ESC)
- The ESC is used to convert signal from Flight controller or radio receiver, and apply the right current to the electric motors.
- Elevator
- Also known as pitch.
- Federal Aviation Administration (FAA)
- A United States Department of Transportation Agency, it has authority to regulate and oversee all aspects of American civil aviation.
- First Person View (FPV)
- A technique that uses an onboard FPV camera and wireless connection, to allow a pilot on the ground to see a live stream video while flying, through a FPV goggle or monitor.
- Flight Control
- System used to fly drones.
- Flight Controller
- the brain of your multirotor. System used to keep track Alerts, schedule drones.
- GCS
- Ground Control Station. Software running on a computer on the ground that receives telemetry information from an airborne UAV and displays its progress and status, often including video and other sensor data. Can also be used to transmit in-flight commands
to the UAV.
- Global Positioning System (GPS)
- Used to track movement or hold position at pre-defined coordinates.
- Gyroscope (GYRO)
- Provides the angular velocity around 3 axes of space in degrees. Assists with keeping a quadcopter level and facing the same direction.
- Lithium Polymer Battery (LIPO)
- Aka LiPoly. Most used power source for RC Hobby these days because of its high energy storage density-to-weight.
- mAh
- milliampere-hour – measure of the current generated by a battery. Quadcopter batteries range from 50 mAh to 5000+ mAh.
- MAVLink.
- The Micro Air Vehicle communications protocol used by the Copter and Plane line of autopilots. See here for more info on MAVLink.
- MAVProxy
- a fully-functioning GCS for UAV’s. The intent is for a minimalist, portable and extendable GCS for any UAV supporting the MAVLink protocol (such as the APM).
- Mission Planner
- Is a full-featured ground station application for the ArduPilot open source autopilot project.
- Multicopter
- Aerial drone with multiple horizontal propellers, also known as rotors. Depending on the number of rotors, we can have tricopters, quadcopters, hexacopters, and octocopters and so on.
- On Screen Display (OSD)
- A piece of hardware that overlays flight data in text or graphical form over an existing live stream video.
- Payload
- The maximum additional weight a drone is able to lift, besides its own weight and the weight of its batteries.
- PX4 (PX4FMU and PX4IO)
- Flight Controller system providing capabilities for stabilized flight, position maintenance and automated mission (waypoint) path following.
- Quadcopter (QUAD)
- A type of multicopter that has 4 motors, no servos, all motors on same level.
- R/C
- Synonym for Radio Controlled.
- Radio Control (RC)
- A device used to control remote controlled vehicles.
- Radio Frequency (RF)
- Common frequency bands RC hobby use are 5.8gHz, 2.4gHz, 1.2gHz, 433mHz, 900mHz Not all bands are available in all countries, and some require a HAM (Amateur Radio Operator) license.
- Radio Receiver (RX)
- A device that receives commands from our radio Transmitter, and sends them directly to the servos or to the Flight Controller.
- Ready to Fly (RTF)
- Refers to the multicopter you buy has everything you need to start flying. You just open up the packaging, charge and install the batteries, and off you go.
- Return To Launch (RTL)
- A GPS feature that when enabled, it returns the aircraft to the “home” position where it took off.
- Revolutions per minute (RPM)
- the number of times a motor shaft rotates a full cycle in 60 seconds.
- Rudder (RUD)
- Also known as yaw.
- Servo
- A shorter name for servomotor or servomechanism. Aerial vehicles use servomotors for various functions such as pan cameras and wing flaps adjustments which can be controlled from the ground.
- Software-in-the-loop (SITL)
- Can be viewed as Simulation-based Software Evaluation. A software system can be executed under simulated input conditions for the purpose of evaluating how well the software system functions under such input conditions.
- Telemetry System
- A two way radio system to allow flight data to be sent from your aircraft and also to allow control or adjustment information to be sent back to it from a “ground station”, commonly a lap top computer. The 3DR telemetric radio is one such system.
- Throttle
- Controls on your radio transmitter, it changes the speed of the motors.
- Transmitter (TX)
- A device that sends our commands to the Receiver, controlled by the pilot.
- Unmanned Aerial Vehicle (UAV)
- Aircraft without a human pilot onboard. Control is provided by an onboard computer, remote control or combination of both.
- Waypoint
- A set of coordinates which define a point in space. Waypoints are useful in designing various autonomous missions for quadcopters. Mapping out would be impossible without a possibility to define these physical locations.
- Yaw
- Flight term used to describe the rotation of a drone around its center axis. Controls which direction the quadcopter is facing.


If you are developing a package, and if you have items in your package that might be rendered in HTML, you should definitely consider using the rendering system. Indeed, it is a simple way to allow your package users to overload your template, if they need to.
For this, you need to provide a Mouf installer for your package, that will be in charge of creating the renderer's Mouf instance. Hopefully, this is fairly easy to do.
First, if you are not used to writing Mouf install scripts for your packages, have a look at the Mouf package installer documentation.
The only thing you need to know is that you should put this line in your installer script:
use Mouf\Html\Renderer\RendererUtils;
RendererUtils::createPackageRenderer($moufManager, "group/package_name");
This will create a renderer instance automatically. Your templates should go in the src/templates directory of your package.
Here is a more details version of what you should do.
First, let's start by creating an install script in src/install.php
require_once __DIR__."/../../../autoload.php";
use Mouf\Actions\InstallUtils;
use Mouf\MoufManager;
use Mouf\Html\Renderer\RendererUtils;
// Let's init Mouf
InstallUtils::init(InstallUtils::$INIT_APP);
$moufManager = MoufManager::getMoufManager();
// Let's create the renderer
RendererUtils::createPackageRenderer($moufManager, "group/package_name");
// Let's rewrite the MoufComponents.php file to save the component
$moufManager->rewriteMouf();
// Finally, let's continue the install
InstallUtils::continueInstall();
You will need to replace the "group/package_name" string with the name of your package.
Finally, we must edit the composer.json file of your package and add this:
{
....
"extra": {
"mouf": {
"install": [
{
"type": "file",
"file": "src/install.php"
}
]
}
}
}
This will register our installer.

Then, each time you install your package, Mouf will propose an installation step in the Mouf UI that will create the renderer installer.
Once you have done this, you can use the renderer in your package, just like a normal application developer would do, e.g.:
HtmlElementInterface
(optional)Renderable
traitNow that we saw how a package developer can provide templates for the application developers, let's have a look at the way things are done on the template developer side


The first thing we did in the intruduction was declaring a new target type:
import type ; type.register VERBATIM : verbatim ;
The type is the most important property of a target. Boost.Build can automatically generate necessary build actions only because you specify the desired type (using the different main target rules), and because Boost.Build can guess the type of sources from their extensions.
The first two parameters for the type.register
rule
are the name of new type and the list of extensions associated with
it. A file with an extension from the list will have the given target
type. In the case where a target of the declared type is generated
from other sources, the first specified extension will be used.
Sometimes you want to change the suffix used for generated targets
depending on build properties, such as toolset. For example, some compiler
uses extension elf
for executable files. You can use the
type.set-generated-target-suffix
rule:
type.set-generated-target-suffix EXE : <toolset>elf : elf ;
A new target type can be inherited from an existing one.
type.register PLUGIN : : SHARED_LIB ;
The above code defines a new type derived from
SHARED_LIB
. Initially, the new type inherits all the
properties of the base type - in particular generators and suffix.
Typically, you'll change the new type in some way. For example, using
type.set-generated-target-suffix
you can set the suffix for
the new type. Or you can write special a generator for the new type. For
example, it can generate additional metainformation for the plugin.
In either way, the PLUGIN
type can be used whenever
SHARED_LIB
can. For example, you can directly link plugins
to an application.
A type can be defined as "main", in which case Boost.Build will automatically declare a main target rule for building targets of that type. More details can be found later.
Sometimes, a file can refer to other files via some include mechanism. To make Boost.Build track dependencies to the included files, you need to provide a scanner. The primary limitation is that only one scanner can be assigned to a target type.
First, we need to declare a new class for the scanner:
class verbatim-scanner : common-scanner { rule pattern ( ) { return "//###include[ ]*\"([^\"]*)\"" ; } }
All the complex logic is in the common-scanner
class, and you only need to override the method that returns
the regular expression to be used for scanning. The
parentheses in the regular expression indicate which part
of the string is the name of the included file. Only the
first parenthesized group in the regular expression will be
recognized; if you can't express everything you want that
way, you can return multiple regular expressions, each of
which contains a parenthesized group to be matched.
After that, we need to register our scanner class:
scanner.register verbatim-scanner : include ;
The value of the second parameter, in this case
include
, specifies the properties that contain the list
of paths that should be searched for the included files.
Finally, we assign the new scanner to the VERBATIM
target type:
type.set-scanner VERBATIM : verbatim-scanner ;
That's enough for scanning include dependencies.


4 Parsl Workflows
4.1 About Parsl
Parsl is a Python-based parallel scripting library that supports development and execution of asynchronous and parallel data-oriented workflows (dataflows). These workflows glue together existing executables (called Apps) and Python functions with control logic written in Python. Parsl brings implicit parallel execution to standard Python scripts. Parsl documentation is available (here)[http://parsl.readthedocs.io/en/latest/].
4.2 Using Parsl
Using parsl is a lot like using plain python. You define scripts that can be run the same way as you would normally run a python script: python3 parsl_script.py
. The main difference with parsl scripts is that they don’t execute on the machine they are run from. The parsl script will provision itself resources on the worker nodes of the cluster and manage where to run jobs without any human intervention. To accomplish this, instead of returning results directly, parsl returns futures. A future is a promise that a function will return a value, usually of a specific type. The future allows parsl to have an understanding of what will be returned from all of the apps it needs to run. This helps parsl to calculate what apps can be run at the same time.
4.3 Parsl Configuration
Parsl requires a configuration in order to understand what kind of an environment in which it is running. On this system, the configuration should be very similar to the example below:
config = {
"sites": [{
"site": "Local_IPP",
"auth": {
"channel": "local"
},
"execution": {
"executor": "ipp",
"provider": "sge",
"script_dir": ".scripts",
"scriptDir": ".scripts",
"block": {
"nodes": 1,
"taskBlocks": 1,
"walltime": "00:05:00",
"initBlocks": 1,
"minBlocks": YOUR_MIN_CORES_HERE,
"maxBlocks": YOUR_MAX_CORES_HERE,
"scriptDir": ".",
"options": {
"partition": "debug"
}
}
}
}],
"globals": {"lazyErrors": True},
"controller": {"profile": "default"},
}
The parsl configuration is a python object, so the example can be pasted into your python script at the top, along with the following line of code:
dfk = DataFlowKernel(config=config)
4.4 Defining a Parsl Workflow
After that, you are ready to start defining your workflow. Here is an example workflow which calculates pi by generating random numbers:
@App('python', dfk)
def pi(total):
# App functions have to import modules they will use.
import random
# Set the size of the box (edge length) in which we drop random points
edge_length = 10000
center = edge_length / 2
c2 = center ** 2
count = 0
for i in range(total):
# Drop a random point in the box.
x, y = random.randint(1, edge_length), random.randint(1, edge_length)
# Count points within the circle
if (x - center)**2 + (y - center)**2 < c2:
count += 1
return (count * 4 / total)
@App('python', dfk)
def avg_n(inputs=[]):
return sum(inputs) / len(inputs)
if __name__ == '__main__':
# Call the workflow:
sims = [pi(10**6) for i in range(10)]
avg_pi = avg_n([task.result() for task in sims])
# Print the results
print("Average: {0:.12f}".format(avg_pi.result()))
You will notice a couple of things that are different from regular python. First, above each app is a decorator ( @App('python', dfk)
). This tells parsl that the app should be run on a worker machine, and not as a normal python function.
Second, the apps which take inputs have a special reserved parameter (inputs
), which you can pass parsl futures into. Passing a future into an app will make the app wait for the result of the future before it runs the app.
Another important thing to remember is that all packages you use (anything you would use the import
statement for) must be imported from within the app, otherwise it will not be accessible from the worker. You can see this in the example here with the random
library.
4.5 Running a Parsl Workflow
After you have the proper configuration and workflow definition, you are ready to run your workflow! Make sure the workflow is in a python file on the login node (mayo) and run it like this: python3 /path/to/your/workflow/file
4.6 Video Tutorial
coming soon….


This is the web app of full stack sample in Dart. It demonstrates using of common packages at the browser-side.


Links
Apps
Github
AM
Good
morning,
Pai
What's your name?
What is your main focus for today?
Settings
Toggle Temperature Unit
Show Weather
Show Clock
Show To-Do
Todo


Video
The HTML Video element is used to play a video file on a web page.
There are three supported audio formats: MP4, WEBM, and OGG.
All of the attributes and events for HTML5 Video are available to use.
MP4
Your browser does not support the video element.
See: HTML5 Video
WEBM
Your browser does not support the video element.
See: HTML5 Video


Before Change
num_exprs_nosharing = 0
with shared_intermediates() as cache:
expr(x, y, z1, backend=backend)
num_exprs_nosharing += len(cache)
with shared_intermediates() as cache:
expr(x, y, z2, backend=backend)
num_exprs_nosharing += len(cache)
print("-" * 40)
print("With sharing:")
with shared_intermediates() as cache:
After Change
print("-" * 40)
print("Without sharing:")
num_exprs_nosharing = Counter()
with shared_intermediates() as cache:
expr(x, y, z1, backend=backend)
num_exprs_nosharing.update(count_cached_ops(cache))
with shared_intermediates() as cache:


reason = "No $DISPLAY"
elif any(importlib.util.find_spec(dep) is None for dep in deps):
reason = "Missing dependency"
backends.append(pytest.mark.skip(reason=reason)(backend) if reason
else backend)
return backends
elif any(importlib.util.find_spec(dep) is None for dep in deps):
reason = "Missing dependency"
if reason:
backend = pytest.param(
backend, marks=pytest.mark.skip(reason=reason))
backends.append(backend)
return backends


{% load templatetag_handlebars %} {% tplhandlebars "grades" %} -->
| MATH 321 23.41% Discrete Math Modeling |
BIOL 101
Biology for dummies
81.54% |
|
ENGL 204
Course title here
23.41% |
MATH 321
Discrete Math Modeling
23.41% |
NOTE: depending on how your Instructor has Canvas conﬁgured, this grade calculation may be for points needed for the entire quarter, rather than for course work due to date. |


Biography
TL;DR: I like technology, system-design, communications, and programming, and I'm good at it. I have a skill set that's best described "jack of all trades, master of none, still better than one". I learn fast, adapt fast and deliver efficiently.
During my BSc, I actually delievered 4 separate senior projects, 2 from electronics engineering and 2 from industrial engineering. The first project was my own senior project.
-
-Computer-vision based automotive side-mirror adjustment system (software design & implementation),
-
-VHDL transceiver design for underwater communications (hardware coding),
-
-City refuse collection system optimization (algorithm development & implementation),
-
-Automotive spare-parts distribution schedule optimization (algorithm development & implementation).
After that I did freelance application development with C/C++ and Java. Also worked on projects related to embedded sensory applications (embedded software and circuit/PCB design).
Did an MSc. and focused on embedded software. I've done my thesis project on creating an infrastructure to carry data for low-cost, low-power, long-range communications with amateur radio bands (optimized IP stack implementation that uses off-the-shelf amateur band modules and PCB design).
I have co-founded a tech company with government funds that works on swarm AI technologies for unmanned vehicles. We also dealt with web/mobile application projects as side-projects for income.
I also now have a PhD
(which I got full scholarship and stipend for) and worked with MIMO radars and sonars for automotive radar applications involving array optimisation and short-range sensing. I then worked as a postdoc research-fellow at MISL of University of Birmingham. My main subjects were spaceborne, synthetic aperture, passive, MTI and MIMO radars (and their combinations).
I've then taken a position at Novit.AI where I implement WSNs, and doing radar and image post-processing and using AI to fuse data to deliver insights to businesses. There, I've developed, from scratch, an
AI pipeline that would generate reports based on periodic influx of satellite-imagery. My final project was
an automated temperature measurement kiosk since we were in the middle of a pandemic...
Oh, while doing that I also taught Digital Design and Embedded Systems modules at Bilkent University Computer Science Dept. for about 3 years and 1 term in Middle East Technical University's Computer Engineering Dept.
Thanks to the rise of normalisation of remote work during pandemic, I then started working as a remote firmware engineer with Dekunu Tech (based in NSW, Australia), a company that produces smart-altimeters for sport skydivers.
Towards the end of the pandemic, I decided it's time move again and started working as a firmware engineer at Xilinx
(now AMD) in Cambridge, UK. We're producing
network accelerator cards.
Though I couldn't keep myself too far away from university so I also had the chance to work as a supervisor for
Concurrent & Distributed Systems and Computer Networks modules for Robinson College of Cambridge University.
As a work-task turned into hobby, I'm also porting
Zephyr RTOS &
picolibc to Microblaze processor nowadays...
Coming soon...


--- title: Contextual Emotion Detection in Text (DoubleDistilBert Model) keywords: fastai sidebar: home_sidebar summary: "We use the excellent pytorch-lightning, Huggingface transformers, and fast.ai nbdev libraries for a clean and efficient implementation and demonstrate the performance of our model on the SemEval-2019 Task 3 dataset." ---
SemEval-2019 Task 3 description:
"Lack of facial expressions and voice modulations make detecting emotions in text a challenging problem. For instance, as humans, on reading "Why don't you ever text me!" we can either interpret it as a sad or angry emotion and the same ambiguity exists for machines. However, the context of dialogue can prove helpful in detection of the emotion. In this task, given a textual dialogue i.e. an utterance along with two previous turns of context, the goal was to infer the underlying emotion of the utterance by choosing from four emotion classes - Happy, Sad, Angry and Others. To facilitate the participation in this task, textual dialogues from user interaction with a conversational agent were taken and annotated for emotion classes after several data processing steps."
Approach: Pre-Trained DistilBert transformers
model for sentence embeddings and contextual information via another Bert model on top
pip install packaging
git clone https://github.com/juliusberner/emotion_transformer
pip install -e emotion_transformer
Hyperparameter search with 2 GPUs and half-precision (automatically done by test_tube
and pytorch_lightning
):
python main.py --gpus=2 --use_16bit --mode=hparams_search
fast.ai nbdev: "nbdev is a library that allows you to fully develop a library in Jupyter Notebooks, putting all your code, tests and documentation in one place."
William Falcon's test tube "Test tube is a python library to track and parallelize hyperparameter search for Deep Learning and ML experiments. It's framework agnostic and built on top of the python argparse API for ease of use."


BBC receives nearly 200 complaints for Strictly Come Dancing same-sex dance
The first same-sex couple dance on the United Kingdom's Strictly Come Dancing has sparked nearly 200 complaints to the BBC.
Professional dancers Graziano Di Prima and Johannes Radebe performed a barefoot routine together during the November 3 show.
Related News
The dancing inspiration you need if you 'can’t dance'
Air NZ bringing back 'Pink Flights' to Mardi Gras
In the BBC's latest complaints round-up, they said 189 people had got in touch to say it was "offensive to feature two men dancing as a pair".
They said Strictly is an inclusive show and they were "proud" to have the dance between Di Prima and Radebe.
"They are dancers first and foremost, and their sex had no bearing on their routine," the BBC said in a statement.
After the dance, Di Prima tweeted "representation always matters" and it was an "unforgettable moment".
Former Strictly winner Joe McFadden congratulated the show for the move and said "the world didn't end" after the two men danced together.
Radebe, who is gay, told Hello! Magazine it was the first time in his life he felt accepted for who he was.
"To be able to dance with a friend I respect and adore is joyous. There's bromance galore between us, but there were no male and female roles, just free movement. It was beautiful, classy and elegant," he said.
The show, currently in its 17th series, has never featured a same-sex pairing between a celebrity and a professional dancer.


Go to the source code of this file.
Functions | |
| CSFML_AUDIO_API sfSoundBufferRecorder * | sfSoundBufferRecorder_create (void) |
| Create a new sound buffer recorder. More... | |
| CSFML_AUDIO_API void | sfSoundBufferRecorder_destroy (sfSoundBufferRecorder *soundBufferRecorder) |
| Destroy a sound buffer recorder. More... | |
| CSFML_AUDIO_API void | sfSoundBufferRecorder_start (sfSoundBufferRecorder *soundBufferRecorder, unsigned int sampleRate) |
| Start the capture of a sound recorder recorder. More... | |
| CSFML_AUDIO_API void | sfSoundBufferRecorder_stop (sfSoundBufferRecorder *soundBufferRecorder) |
| Stop the capture of a sound recorder. More... | |
| CSFML_AUDIO_API unsigned int | sfSoundBufferRecorder_getSampleRate (const sfSoundBufferRecorder *soundBufferRecorder) |
| Get the sample rate of a sound buffer recorder. More... | |
| CSFML_AUDIO_API const sfSoundBuffer * | sfSoundBufferRecorder_getBuffer (const sfSoundBufferRecorder *soundBufferRecorder) |
| Get the sound buffer containing the captured audio data. More... | |
| CSFML_AUDIO_API sfSoundBufferRecorder* sfSoundBufferRecorder_create | ( | void | ) |
Create a new sound buffer recorder.
| CSFML_AUDIO_API void sfSoundBufferRecorder_destroy | ( | sfSoundBufferRecorder * | soundBufferRecorder | ) |
Destroy a sound buffer recorder.
| soundBufferRecorder | Sound buffer recorder to destroy |
| CSFML_AUDIO_API const sfSoundBuffer* sfSoundBufferRecorder_getBuffer | ( | const sfSoundBufferRecorder * | soundBufferRecorder | ) |
Get the sound buffer containing the captured audio data.
The sound buffer is valid only after the capture has ended. This function provides a read-only access to the internal sound buffer, but it can be copied if you need to make any modification to it.
| soundBufferRecorder | Sound buffer recorder object |
| CSFML_AUDIO_API unsigned int sfSoundBufferRecorder_getSampleRate | ( | const sfSoundBufferRecorder * | soundBufferRecorder | ) |
Get the sample rate of a sound buffer recorder.
The sample rate defines the number of audio samples captured per second. The higher, the better the quality (for example, 44100 samples/sec is CD quality).
| soundBufferRecorder | Sound buffer recorder object |
| CSFML_AUDIO_API void sfSoundBufferRecorder_start | ( | sfSoundBufferRecorder * | soundBufferRecorder, |
| unsigned int | sampleRate | ||
| ) |
Start the capture of a sound recorder recorder.
The sampleRate parameter defines the number of audio samples captured per second. The higher, the better the quality (for example, 44100 samples/sec is CD quality). This function uses its own thread so that it doesn't block the rest of the program while the capture runs. Please note that only one capture can happen at the same time.
| soundBufferRecorder | Sound buffer recorder object |
| sampleRate | Desired capture rate, in number of samples per second |
| CSFML_AUDIO_API void sfSoundBufferRecorder_stop | ( | sfSoundBufferRecorder * | soundBufferRecorder | ) |
Stop the capture of a sound recorder.
| soundBufferRecorder | Sound buffer recorder object |


Package
Class
Tree
Deprecated
Index
Help
PREV NEXT
FRAMES
NO FRAMES
All Classes
A
C
D
G
H
P
R
S
W
A
addImage(String, int, int, int, int)
- Method in class db3.
PowerPoint
Adds an image to the current slide - only jpg supported
addSlide(String)
- Method in class db3.
PowerPoint
Adds a new slide to the presentation.
addTextBox(String)
- Method in class db3.
PowerPoint
Adds a new text box to the current slide
C
close()
- Method in class db3.
SpreadSheet
Closes the SpreadSheet file
D
db3
- package db3
G
getCurrentSlideTitle()
- Method in class db3.
PowerPoint
Returns the title of the current slide
getIntCell(int, int)
- Method in class db3.
SpreadSheet
Extracts a value at the row cell intersection
getLongCell(int, int)
- Method in class db3.
SpreadSheet
Extracts a value at the row cell intersection
getRowCell(int, int)
- Method in class db3.
SpreadSheet
Extracts a value at the row cell intersection
H
howManySlides()
- Method in class db3.
PowerPoint
Returns the number of slides in the slide show
P
PowerPoint
- Class in
db3
This class creates a Power Point presentation
PowerPoint(String)
- Constructor for class db3.
PowerPoint
Instantiates the PowerPoint object
R
rows()
- Method in class db3.
SpreadSheet
Returns the number of rows in the first sheet
S
SpreadSheet
- Class in
db3
This class facilitates SpreadSheet access.
SpreadSheet(String, int)
- Constructor for class db3.
SpreadSheet
Creates a SpreadSheet object, opens the specified spreadsheet and accesses the first sheet in the file
W
writePresentation()
- Method in class db3.
PowerPoint
Writes the presentation to the file (Before this, the entire presentation is held in memory - Only when this method is called is the presentation written to the file and the file is closed)
A
C
D
G
H
P
R
S
W
Package
Class
Tree
Deprecated
Index
Help
PREV NEXT
FRAMES
NO FRAMES
All Classes


Overview
- Introduction
- Decision Trees
- K-Nearest Neighbors
- Linear Regression
- Statistical Learning
- Mixture of Gaussians
- Logistic Regression
- Generalized Linear Models
- Artificial Neural Networks
- Kernel Methods
- Gaussian Processes
- Support Vector Machines
- Deep Neural Networks
- Convolutional Neural Networks
- Recurrent and Recursive Neural Networks
- Ensemble Learning
- Stream Learning
These notes are a result of my preparation for a midterm exam in Pascal Poupart’s course on Machine Learning at University of Waterloo in the winter 2016 term. The contents are therefore based on the corresponding presentation slides available online.
Introduction
Definition by Tom Mitchell (1988): “A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P if its performance for tasks in T, as measured by P, improves with experience E.”
Inductive Learning: given a training set of examples of the form $(x, f(X))$, return a function $h$ (hypothesis) that approximates $f$ (true underlying function).
The quality measure for hypotheses is generalization. A good hypothesis will generalize well, i.e., predict unseen examples correctly. Ockham’s razor suggests to prefer the simplest hypothesis consistent with the input data.
Two different types of inductive learning:
- Classification: range/output space of $f$ is categorical (or discrete)
- Regression: range/output space of $f$ is continuous
Hypothesis space $H$: set of all possible $h$
Consistency: $h$ is consistent if it agrees with $f$ on all examples; it is not always possible to find a consistent $h$ (e.g., due to an insufficient $H$ or noisy input data)
Realizability: a learning problem is realizable if and only if $f$ is in $H$
In general, we will observe a tradeoff between expressiveness (i.e., the size of $H$) and the complexity of finding a good $h$.
Overfitting: given a hypothesis space $H$, a hypothesis $h \in H$ is said to overfit the training data if there exists some alternative hypothesis $h’ \in H$ such that $h$ has smaller error than $h’$ over the training examples, but $h’$ has smaller error than $h$ over the entire distribution of instances.
$k$-fold cross-validation: run $k$ experiments, each time putting aside $\frac{1}{k}$ of the data to test on and, finally, compute the average accuracy of the experiments
Decision Trees
Decision trees (a.k.a. Classification and Regression Trees [CART]) represent disjunctions (OR) of conjunctions (AND) of constraints of attribute values.
Decision trees have the following structure:
- nodes: attributes
- edges: attribute values
- leaves: classes / regression values
Quality measure for decision trees:
- small size
- high consistency
Greedy induction of a decision tree:
- depth-first search like construction
- a good attribute splits the examples into subsets that are ideally all from the same class or, in other words, that minimizes the residual error
Residual error for classification:
| Error Frequency | Gini Index | Entropy | |
|---|---|---|---|
| Definition | $Q_\tau=num(\tau)-max_k num(k)$ | $Q_\tau=\sum_kp_\tau(k)(1-p_\tau(k))$ | $Q_t=-\sum_kp_\tau(k) \ ld \ p_\tau(k)$ |
| Explanation | Number of examples in leaf $\tau$ minus maximum number of examples in leaf $\tau$ that belong to any class $k$ | Expected misclassification when choosing the class according to $p_\tau(k)$ | Expected # of bits to encode the class of an instance chosen at random according to $p_\tau(k)$ |
Variables:
- $\tau$: index for leaf $\tau$
- $k$: index for class $k$
- $num(\tau)$: number of examples in leaf $\tau$
- $num(k)$: number of examples in leaf $\tau$ belonging to class $k$
- $p_\tau(k) = \frac{num(k)}{num(\tau)}$
Residual error for regression:
- Let $t_n = f(x_n)$ be the target for the $n^{th}$ example.
- Let $y_t$ be the value returned by leaf $\tau$.
- Let $R_\tau$ be the set of examples in leaf $\tau$.
- Euclidean error for leaf $\tau$: $Q_\tau=\sum_{n \in R_\tau}(t_n-y_n)^2$
Choosing the best attribute for the next decision layer in the tree:
- In leaf $\tau$, choose attribute $A$ that reduces the residual error the most when expanded:
- $A^*=argmax_AQ_\tau-\sum_{a \in A}p_\tau(A=a)Q_{\tau a}$, where
- $p_\tau(A=a)=\frac{num(A=a)}{num(\tau)}$ denotes the proportion of examples with value $a$ (in attribute $A$) inside node $\tau$
- $\tau a$ indexes the node reached by following the edge for attribute value $a$, starting from node $\tau$
Techniques to avoid overfitting:
- Stop learning when the curve for testing accuracy, plotted against the tree size, has reached its global peak; in practice, this is sometimes sometimes hard to achieve because the curve might exhibit high fluctuation
- Pruning of statistically irrelevant nodes in a bottom-up fashion
- Remove nodes that improve testing accuracy by less than some threshold
- Regularization: add a penalty term that reflects the tree complexity (e.g., $|T|=$ #leaves in the tree) and remove leaves with a negative “regularized” error reduction: $Q_\tau-\sum_{a \in A}p_\tau(A=a)Q_{\tau a}-\lambda|T|$
K-Nearest Neighbors
In the limit, single-attribute thresholding to construct decision trees for attributes with continuous inputs will lead to a full tree with one input example per leaf. Decision boundaries will always be axis-aligned. A better approach without this restriction is $K$-Nearest Neighbors.
Approach:
- Let $knn(x)$ be the $K$ nearest neighbors of $x$ according to distance $d$
- Label $y_x=mode({y_x’ \mid x’ \in knn(x)})$, i.e., the most frequent label among the $K$ nearest neighbors
- $K$ controls the degree of smoothing and can be optimized using $k$-fold cross-validation (if $K$ is too small this will lead to overfitting; if $K$ is too high this will lead to underfitting)
Comparison of complexity between decision trees and $K$-Nearest Neighbors with respect to:
- $N$: size of training set
- $M$: number of attributes
| Training | Testing | |
|---|---|---|
| Decision Tree | $O(M^2N)$ | $O(M)$ |
| $K$-Nearest Neighbors | $O(MN)$ | $O(MN)$ |
A good visualization of the decision boundaries for the two-dimensional 1-Nearest Neighbor case assuming Euclidean distance is the Voronoi diagram.
Linear Regression
Data: ${(x_1, t_1),(x_2,t_2),…,(x_N,t_N)}$ where $x_n \in \mathbb{R}^D$ and $t_n \in \mathbb{R}$
Problem: find linear hypothesis $h$ that maps $x$ to $t$; in other words, try to find a weight vector $w \in \mathbb{R}^{D+1}$ so that the error for $h(x,w)=w^T\overline{x}$ with $\overline{x}=\begin{pmatrix} 1 \ x \end{pmatrix}$ over all $x$ in the dataset is minimal
Solution: $ Aw=b $ with:
- $A=\sum_{n=1}^N\overline{x}_n\overline{x}_n^T$ (invertible if the training instances span $\mathbb{R}^{D+1}$)
- $b=\sum_{n=1}^Nt_n\overline{x}_n$
Tikhonov Regularization: a technique, applied to avoid a form of overfitting where small changes to the input data lead to big changes in the learned weight vector: $(\lambda I+A)w=b$. The greater $\lambda$ the smaller the magnitude of $w$ will be.
Statistical Learning
Idea: learning simply reduces the uncertainty in our knowledge of the world
Marginal Probability Distribution: specification of a probability for each event in our sample space; all probabilities must sum up to $1$
Joint Probability Distribution: specification of probabilities for all combinations of events: $Pr(A=a \wedge B=b)$ for all $a$, $b$
Marginalization (sumout rule): $Pr(A=a)=\sum_bPr(A=a \wedge B=b)$
Conditional Probability: fraction of worlds in which $B$ is true that also have $A$ true: $Pr(A \mid B)=\frac{Pr(A \wedge B)}{Pr(B)}$; also $Pr(A \wedge B)=Pr(A \mid B) \ Pr(B)$
Bayes’ Rule: $Pr(B \mid A)=\frac{Pr(A \mid B) \ Pr(B)}{Pr(A)}$
Bayesian Inference: $P(H \mid e)=kP(e \mid H) \ P(H)$
- $H$: hypothesis
- $e$: evidence
- $P(H)$: prior probability of $H$
- $P(e \mid H)=\prod_nP(e_n \mid H)$: likelihood of observing $e$, given $H$
- $P(H \mid e)$: posterior probability of $H$, given $e$
- $k$: normalizing factor, applied so that all posteriors sum up to $1$
Bayesian Prediction: $P(X \mid e)=\sum_iP(X \mid h_i) \ P(h_i \mid e)$
Properties of Bayesian Learning: optimal and not prone to overfitting, but potentially intractable if the hypothesis space is large
Approximations of Bayesian Learning:
- Maximum a Posteriori (MAP):
- making predictions, based on the most probable hypothesis $h_{MAP}=argmax_{h_i}P(h_i \mid e)$
- less accurate than Bayesian prediction, but both converge in accuracy as data increases
- controlled overfitting (prior can be used to penalize complex hypotheses)
- MAP for linear regression leads to regularized least square problem
- Maximum Likelihood (ML):
- MAP with uniform prior: $h_{ML}=argmax_{h_i}P(e \mid h_i)$
- less accurate than Bayesian and MAP prediction, but all three converge in accuracy as data increases
- prone to overfitting
- ML for linear regression leads to non-regularized least square problem
Bias-Variance Decomposition for linear regression: $expected \ loss = (bias)^2 + variance + noise$
- bias increases as regularization parameter $\lambda$ increases
- variance decreases as regularization parameter $\lambda$ increases
- noise is constant
Mixture of Gaussians
Purpose: linear classification technique
Assumptions:
- $Pr(C=c_k)=\pi_k$: prior probability of class $k$
- $Pr(x \mid C=c_k) \propto e^{-0.5(x-\mu_k)^T\Sigma^{-1}(x-\mu_k)}$: likelihood of data point $x$, given class $k$, is a Gaussian distribution with the same covariance matrix $\Sigma$ for all classes
- $Pr(C=c_k \mid x)=kPr(x \mid C=c_k)Pr(C=c_k)$: posterior probability of class $k$, given data point $x$
For two classes $A$ and $B$ (using sigmoid):
$Pr(C=A)=\sigma(w^Tx+w_0)$ where
- $\sigma(a) = \frac{1}{1+e^{-a}}$ (sigmoid function)
- $w=\Sigma^{-1}(\mu_A-\mu_B)$
- $w_0=-0.5\mu_A^T\Sigma^{-1}\mu_A+0.5\mu_B^T\Sigma^{-1}\mu_B+ln\frac{\pi_A}{\pi_B}$
- $\pi_k:$ fraction of training examples that belong to class $k$ (via maximum likelihood)
- $\mu_k:$ empirical mean of all training examples that belong to class $k$ (via maximum likelihood)
- $\Sigma=\frac{S_A+S_B}{N}$: normalized sum of covariance matrices (via maximum likelihood)
- $S_k=\sum_{n \in c_k}(x_n-\mu_k)(x_n-\mu_k)^T$
For multiple classes (using softmax):
$Pr(C=c_k \mid x)=\frac{e^{w_k^T\overline{x}}}{\sum_je^{w_j^T\overline{x}}}$
Prediction: best class $k^*=argmax_kPr(c_k \mid x)$
Logistic Regression
Purpose: linear classification technique (can be viewed as a regression where the goal is to estimate a posterior probability which is continuous)
Assumption: $Pr(x \mid C=c_k)$ are members of the exponential family: $Pr(x \mid \Theta_k)=exp(\Theta_k^TT(x)-A(\Theta_k)+B(x))$
Derivation: $Pr(C=c_k \mid x)=\sigma(w^T\overline{x})$: the posterior probability of class $k$ is a sigmoid logistic linear in $x$ (or softmax linear in $x$ for more than two classes)
Idea: learning $Pr(C=c_k \mid x)$ directly by maximum likelihood
Implementation for binary classification:
- $y \in {0,1}$
- $w^*=argmax_w\prod_n\sigma(w^T\overline{x})^{y_n}(1-\sigma(w^T\overline{x}))^{1-y_n}$
- $ \ \ \ \ \ =argmin_w-\sum_nln(\sigma(w^T\overline{x}))+(1-y_n)ln(1-\sigma(w^T\overline{x}))$
- Derivative $\nabla L(w)=\sum_n(\sigma(w^T\overline{x})-y_n)\overline{x}_n$
- Solve derivative iteratively for $0$ using Newton’s method: $w_{i+1}=w_i-H^{-1}\nabla L(w)$ where
- $H=\overline{X}R\overline{X}^T$ is the Hessian matrix, $X$ being the training data matrix where each column is represents one input vector
- $R$ is a diagonal matrix of size $N*N$ with entries of $\sigma_n(1-\sigma_n)$
- $\sigma_n=\sigma(w_i^T\overline{x}_n)$
Generalized Linear Models
Purpose: non-linear classification/regression
Idea: map inputs to a different space using a set of basis functions and do linear classification/regression in that space
Common basis functions:
- Polynomial: $\theta_j(x)=x^j$
- Gaussian: $\theta_j(x)=e^{-\frac{(x-\mu_j)^2}{2s^2}}$
- Sigmoid: $\theta_j(x)=\sigma(\frac{(x-\mu_j)^2}{s})$
- Fourier, Wavelets etc.
Artificial Neural Networks
Purpose: non-linear classification/regression
Idea: network of units similar to neurons in a human brain
Implementation: numerical output of unit $j$, $h(a_j)$ where
- $a_j=\sum_{i}W_{ji}x_i+w_0=W_j\overline{x}$
- $x_i$ is the output of unit $i$
- $W_{ji}$ denotes the strength of the link from unit $i$ to unit $j$
- $h(x)$ is the activation function (e.g., threshold, sigmoid, Gaussian, hyperbolic tangent, identity)
Structures:
- feed-forward network (directed acyclic graph)
- recurrent network (directed cyclic graph)
Perceptron: single-layer feed-forward network
- Threshold Perceptron Learning:
- done separately for each unit $j$
- for each $(x,y)$ pair, correct weight $W_{ji}$ if incorrect output is produced:
- if output produced is $0$ instead of $1$: $W_{ji}=W_{ji}+x_i$
- if output produced is $1$ instead of $0$: $W_{ji}=W_{ji}-x_i$
- convergence if and only if the dataset is linearly separable
- Sigmoid Perceptron Learning:
- same hypothesis space as logistic regression
Multi-layer neural networks: flexible non-linear models by learning non-linear basis functions
- examples of 2-layer feed-forward networks:
- $h_1$ non-linear and $h_2$ sigmoid: non-linear classification
- $h_1$ non-linear and $h_2$ identity: non-linear regression
Back Propagation:
- Purpose: learning by iteratively adjusting network’s weights to minimze output error
- Two phases:
- Forward phase: compute output $z_j$ for each unit $j$
- Backward phase: compute delta $\delta_j$ at each unit $j$:
- if $j$ is an output unit: $\delta_j=h’(a_j)(y_j-z_j)$
- if $j$ is a hidden unit: $\delta_j=h’(a_j)\sum_kw_{kj}\delta_k$ (recursion) where all units $k$ are the ones that receive input from unit $j$
- update weights: $w_{ji} \leftarrow w_{ji} - \alpha \ \delta_j z_i$
Kernel Methods
Key idea: use a large (possibly infinite) set of fixed, non-linear functions; normally, the computational complexity depends on the number of basis functions used, but by a “dual trick”, complexity depends on the amount of data.
Kernel function: $k(x, x’) = \phi(x)^T \phi(x’)$
Gram matrix: $K = \Phi^T \Phi$
Prediction for kernelized linear regression: $y_n = k(\cdot, x_n)^T (K + \lambda I)^{-1}y$ where $k(\cdot, x_n) = k(x, x_n) \ \forall \ x$
Constructing kernels $K$:
- Valid kernels must be positive semi-definite (= all eigenvalues must be $\geq 0$); in other words, the $K$ must factor into a product of a transposed matrix by itself ($K = \Phi^T \Phi$)
- There are well-defined rules that can be applied to combine kernels with each other to create new kernels, preserving the property of positive semi-definiteness
- Kernels can be defined with respect to other things than vector such as sets, strings or graphs.
Common kernels ($k(x, x’) =$ …):
- Polynomial: $(x^T x’)^M$; feature space: all degree $M$ products of entries in $x$
- General Polynomial: $(x^T x’ + c)^M$ with $c > 0$; feature space: all products of up to $M$ products of entries in $x$
- Gaussian: $\exp({-\frac{\mid x - x’ \mid^2}{2 \sigma^2}})$; feature space: infinite!
Gaussian Processes
Key idea: approximating the true function $f(x)$ by an infinite-dimensional Gaussian distribution over functions $P(f)$
Distribution over functions: $f(x) \sim GP(m(x), k(x, x’)) \ \forall x, x’$ where
- $m(x) = E(f(x))$ is the mean (= zero because the expectation of a zero-centered Gaussian is zero)
- $k(x, x’) = E((f(x) - m(x)) (f(x’) - m(x’))) = \frac{\phi(x)^T \phi(x’)}{\alpha}$ is the kernel covariance function
Gaussian Process Regression: corresponds to kernelized Bayesian linear regression with a function view instead of a weight space view, posteriors over $f$ instead of $w$ and a complexity, cubic in the number of training points instead of cubic in the number of basis functions. Prediction:
- $P(y’ \mid x’, X, y) = N(\bar{f}(x’), k’(x’, x’))$ where
- $\bar{f}(\cdot) = k(\cdot, X) \ A \ y$
- $k’(\cdot, \cdot) = k(\cdot, \cdot) - k(\cdot, X) \ A \ k(X, \cdot)$
- $A = (K + \sigma^2 I)^{-1}$ (the inversion of this step is cubic in the number of training points
Support Vector Machines
Key idea: find the decision hyperplane that maximizes the distances to the closest data point, resulting in a unique and globally optimal max-margin separator that can be found in polynomial time.
Optimization problem:
- $\max_w \frac{1}{\mid w \mid} \min_n y_n w^T \phi(x_n)$
- Alternatively, set the minimum distance to 1 and minimize $\mid w \mid$: $\min_w \frac{1}{2}{\mid w \mid}^2$ such that $y_n w^T \phi(x_n) \geq 1 \ \forall \ n$ (only the points where the distance is 1 are necessary to define the active constraints and are called support vectors)
- This optimization can be reformulated as a kernelized dual problem, given by: $\max_a \sum_n a_n - \frac{1}{2} \sum_n \sum_{n’} a_n a_{n’} y_n y_{n’} k(x_n, x_{n’})$ such that $\sum_n a_n y_n = 0$ and $a_n \geq 0 \ \forall \ n$ (many $a_n$ will be zero, they will be non-zero only for the support vectors)
Prediction:
- Primal problem: $y_* = sign(w^T \phi(x_*))$
- Dual problem: $y_* = sign(\sum_n a_n y_n k(x_n, x_*))$
Soft margin: for data that is not linearly separable, slack variables may be introduced into the optimzation problem to handle minor misclassifications: $\min_w C \sum_n \xi_n + \frac{1}{2}{\mid w \mid}^2$ such that $y_n w^T \phi(x_n) \geq 1 - \xi_n$ and $\xi_n \geq 0 \ \forall \ n$; slack variable $\xi_n$ will be $> 0$ for misclassified examples and $C$ controls the trade-off between the slack variable penalty and the margin; $C$ can also be interpreted as a regularization parameter; when $C \rightarrow \infty$ we arrive again at the hard margin problem; support vectors are all points that are in the margin or misclassified;
Multiclass SMVs:
- One-Against-All: for $K$ classes, train $K$ SMVs to distinguish each class from the rest; drawback: there will be regions that are either claimed by no class or by multiple classes
- Pairwise Comparison: train $O(K^2)$ SMVs to compare each pair of classes; drawbacks: computationally expensive and it is not obvious how the best class should be picked
- Continuous Ranking: single SVM that returns a continuous value to rank all classes (most popular approach today); idea: instead of computing the sign of a linear separator, compare the values of linear functions for each class $k$; classification: $y_* = \arg\max_k w_k^T \phi(x_*)$
Hidden Markov Models
Key idea: make use of sequential correlations between classes
Assumptions:
- Stationary process: transition and emission distributions are identical at each time step: $P(x_t \mid y_t) = P(x_{t+1} \mid y_{t+1})$ and $P(y_t \mid y_{t-1}) = P(y_{t+1} \mid y_t) \ \forall \ t$
- Markovian process: next state is independent of previous states given the current state: $P(y_{t+1} \mid y_{t}, y_{t-1}, …, y_{1}) = P(y_{t+1} \mid y_{t}) \ \forall \ t$
Parametetrization:
- Initial state distribution: $\pi = P(y_1)$
- Transition distribution: $\theta = P(y_{t} \mid y_{t - 1})$
- Emission distribution: $\phi = P(x_t \mid y_t)$
Inference:
- Monitoring: $P(y_t \mid x_{1..t})$; forward algorithm has linear complexity in $t$
- Prediction: $P(y_{t+k} \mid x_{1..t})$; forward algorithm has linear compelxity in $t + k$
- Hindsight: $P(y_{k} \mid x_{1..t})$ where $k < t$; forward-backward algorithm has linear complexity in $t$
- Most likely explanation: $\arg\max_{y_1,…y_t}P(y_{1..t} \mid x_{1..t})$; Viterbi algorithm has linear complexity in $t$
Maximum likelihood objectives:
- Supervised: $\pi’,\theta’,\phi’ = \arg\max_{\pi,\theta,\phi} P(y_{1..T},x_{1..T} \mid \pi,\theta,\phi)$
- Unsupervised: $\pi’,\theta’,\phi’ = \arg\max_{\pi,\theta,\phi} P(x_{1..T} \mid \pi,\theta,\phi)$
Deep Neural Networks
Definition: neural network with many hidden layers, providing a high level of expressivity (as the number of layers is increased, the number of units needed may decrease exponentially; example: parity function)
Problems:
-
Gradient vanishing: deep neural networks of sigmoid and hyperbolic units often suffer from vanishing gradients (because the derivative of these activation functions is always $< 1$); for this problem, two popular solutions exist:
- Pre-training of weights
-
Other types of activation functions:
- Rectified Linear Units:
- Hard version: $g(x) = \max(0, x)$
- Soft version (“Softplus”): $g(x) = \log(1 + e^x)$
- Maxout Units: operate on vector-typed weights and output the maximum value of all the linear combinations of different subsets of input weights
- Rectified Linear Units:
-
Overfitting: high expressivity increases the risk for overfitting; for this problem, three popular solutions exist:
- Regularization
- Data augmentation (to ensure that the number of parameters in the deep neural net is lower than the amount of data
- Dropout: random “drop” some (input and hidden) units from the network when training; during prediction, multiply the output of each unit by one minus its dropout probability; dropout can be seen as a form of ensemble learning for neural networks
Convolutional Neural Networks
Key idea: learn convolutional features in sequential, spatial or tensor data (e.g., pixels from an input image) in a flexible way. An equivariant representation of the learned model ensures (partial) translation invariance and handling of variable-length inputs.
Convolution: in neural networks, a convolution denotes the linear combination of a subset of units based on a specific pattern of weights. Convolutions are often combined with activation functions to produce a feature value.
Pooling: commutative mathematical operation that combines several units (e.g., max, sum, product, Euclidean norm etc.)
Convolutional Neural Network (CNN): any ANN that includes an alternation of convolution and pooling layers where some of the convolution weights are shared. CNNs are also trained using backpropagation, but gradients of shared weights are combined into a single gradient.
Recurrent and Recursive Neural Networks
Key idea: facilitate processing of variable-length data by instantiating recurrent or recursive patterns in the network.
Recurrent Neural Network: outputs can be fed back to the network as inputs, creating a recurrent structure that can be unrolled to handle variable-length data. Recurrent neural networks are trained by backpropagation on the unrolled network, combining gradients of shared weights into a single gradient. The Encoder-Decoder model is a model mapping input sequences to output sequences (e.g., for machine translation, question answering, dialog).
Recursive Neural Network: generalize recurrent neural networks from chains to trees. Parse trees or dependency graphs are used as structures for recursive neural networks. The Long-Short-Term-Memory (LSTM) model is a special gated structure to control memorization and forgetting in recursive neural networks, facilitating long-term memory.
Ensemble Learning
Key idea: combine several imperfect hypotheses into a better hypothesis
Assumptions:
- each hypothesis $h_i$ makes error with probability $p$
- the hypotheses are independent
Probabilities of making errors using majority vote of $n$ hypotheses under these assumptions*:
- $k \leq n$ hypotheses make an error: $p_e(k) = \binom{n}{k} p^k (1-p)^{n-k}$
- majority makes an error: $\sum_{k=\frac{1}{2}n}^n p_e(k)$
Weighted majority: as the above two assumptions are rarely true, hypotheses can be weighted lower if:
- they are correlated
- they have a lower classification performance
Boosting: technique to “boost” a weak learner by training multiple parametrizations of the same base model using weighted variations of the training set. One popular implementation is AdaBoost.
-
Boosting algorithm:
- set all instance weights $w_x$ to 1
- repeat until sufficient number of hypotheses:
- $h_i \leftarrow$ learn(dataset, weights)
- increase $w_x$ of misclassified instances $x$
- ensemble hypothesis is the weighted majority of all $h_i$ with weights $z_i$ proportional to the accuracy of $h_i$
-
Requirement: a weak learner (i.e., a model producing hypotheses at least as good as random), e.g., rules of thumb, decision stumps (= decision trees of one node), perceptrons, naive bayes models
Bagging (= bootstrap aggregation): technique to improve the accuracy of a weak learner by sampling a subset of both the samples and features to obtain independent classifiers; prediction is then done by a simple majority vote (without weighting). Random forests are bags of decision trees.
-
Bagging algorithm:
- repeat until sufficient number $K$ of hypotheses:
- bootstrap sampling: $D_k \leftarrow$ sample data subset
- random projection: $F_k \leftarrow$ sample feature subset
- training: $h_k \leftarrow$ learn($D_k$, $F_k$)
- ensemble hypothesis is the (non-weighted) majority of all $h_k$ for classification or the average output for regression
- repeat until sufficient number $K$ of hypotheses:
| Boosting | Bagging | |
|---|---|---|
| Sampling | reweight instances in dataset | sample subset of data and features |
| Classifiers obtained | complementary | independent |
| Prediction | weighted majority vote | majority vote (no weighting) |
Stream Learning
Key idea: instead of training one hypothesis on a fixed dataset, continuously update a preliminary hypothesis as new data points arrive.
Challenges:
- since the data is streaming, it cannot all be stored $\rightarrow$ old data cannot necessarily be revisited
- time to process new incoming data must be constant and less than the arrival time for the next batch of data
Solutions:
- Bayesian Learning: lends itself naturally to stream learning because it stores information about training data in a product of likelihood distributions which can be updated incrementally every time a new data point comes in
-
Stochastic Gradient Descent (SGD): for optimization-based learners like least square regression, logistic regression, maximum likelihood, support vector machines and neural networks, gradient descent can be implemented as an incremental approach where the model parameters are updated based on every incoming data point $(x_n, y_n)$ in isolation (as opposed to all existing data points at once), weighting the corresponding loss gradient by a data point specific learning rate $\alpha_n$.
-
Robins-Monro conditions: convergence is only guaranteed if the learning rate staisfies the Robins-Monro conditions of $\sum_{\alpha_n=1}^\infty \alpha_n = \infty$ and $\sum_{\alpha_n=1}^\infty \alpha_n^2 < \infty$; an example of such an update rule for learning rate $\alpha_n$ that satisfies these conditions is: $\alpha_n = \frac{1}{(\tau + n)^k}$ where $\tau \geq 0$ and $k \in (0.5, 1]$
-
AdaGrad: form of SDG that is often used in backpropagation. In AdaGrad, the model parameters $\theta$ are updated as follows: $\theta_m^{(n+1)} \leftarrow \theta_m^{(n)} - \frac{\alpha}{\tau + \sqrt{s_m^{(n)}}} \frac{\delta Loss(x_n; y_n; \theta^{(n)})}{\delta \theta_m^{(n)}}$ where $s_m^{(n)} \leftarrow s_m^{(n - 1)} + (\frac{\delta Loss(x_n; y_n; \theta^{(n)})}{\delta \theta_m^{(n)}})^2$
-


a short biography
hi. i'm joon. i live in cambodia and attend logos international school.i've been living here for about 14 years and it's been great.
i enjoy theater and movies and bland coffee.
also, you might've noticed that i do not like capital letters.
panama - always


The Magical Child art series emphasizes nature, play and discovery. Each art piece is hand drawn by artist Lindsay Carron designed to alleviate stress associated with hospital stays.
Ki is our interactive host welcoming children into...
Brought to life with augmented reality technology, the artwork invites the child to leap into a magical world
Patients can use the App in bed while they rest
Open the app and point the smart device towards the Magical Child artwork
Tap specific animals and watch them come to life in 3D augmented animation
A hidden artistic world comes alive at the patient's fingertips offering a fun and meditative reprieve from stress
As an Integrative Medicine practitioner for over 20 years, Cindy Starry innovates healthcare through the combination of art and technology. She facilitates creative and nurturing patient and caregiver experiences that reach beyond the hospital walls.
Lindsay travels around the world to bring magical experiences to life with her drawings that remind us all of the life-giving beauty of our earth.
<EMAIL_ADDRESS>949-338-7470
<EMAIL_ADDRESS>414-530-2559


Text only
This is some bold text.
This is some italic text. And this is some bold and italic text.
This text is underlined.
This is big.


--- layout: archive title: Zulip Chat Archive permalink: /stream/113488-general/topic/mathlib.20import.20graph.html ---
Yesterday, @Scott Morrison asked for the current mathlib import graph, without having to install anything. This is available at https://www.yworks.com/yed-live/?file=https://gist.githubusercontent.com/PatrickMassot/a23fb34e1b26409f10013de07525ece8/raw/ae80aec753cbf37b36ca683c94db08b99f0cf36b/import_graph, but this will require your web browser to be patient.
Do you have it in some text format (e.g., graphviz)?
Sure.
Thank you!
Do we have any tool to determine unneeded import
s?
I think we used to have something testing that in CI, but it was driving people crazy.
The category_theory.limits.shapes.constructions.sums
module doesn't have any edges: https://github.com/leanprover-community/mathlib/blob/38544f14662d9d1fd97bd1fb132213c546292025/src/category_theory/limits/shapes/constructions/sums.lean
Yes, this is among the most sober files in mathlib.
I think this was already noticed when writing the mathlib paper, but somehow it was decided not to fix it.
Probably it's meant as a placeholder
There are 648 nodes in this graph (and 1764 edges), we can afford a couple of empty nodes.
But note that https://github.com/leanprover-community/mathlib/blob/38544f14662d9d1fd97bd1fb132213c546292025/src/category_theory/limits/shapes/constructions/finite_products.lean is conceptually closely related to that file, it almost counts as an edge.
I didn't know this was allowed! It reminds me of all the directories here (when I was recently trying to figure out what maths has been done in HoTT theories)
This not really allowed, this is more like overlooked.
I think this was already noticed when writing the mathlib paper, but somehow it was decided not to fix it.
Was it decided or just forgotten? The "placeholder" has been empty for 7 months, I think a PR deleting empty files would be welcome.
Yury G. Kudryashov said:
Do we have any tool to determine unneeded
import
s?
Simon and Mario's olean-rs tool does this, iirc
This is why I wrote it was more overlooked than allowed.
Yury G. Kudryashov said:
Do we have any tool to determine unneeded
import
s?
ooh found one import.png Might take a while to do it by hand though
I'm not sure this is what Yury wanted.
But maybe it is.
Oh -- imports which aren't used?
There are two kinds of useless imports. Those which are unused and those which would be imported by transitivity anyway.
I guess that is the more important issue. I should imagine that the loop above makes no difference to anything.
I was talking about something like this
I just opened https://github.com/leanprover-community/mathlib-tools/pull/38 for people interested in import graphs. It's purely about imports, not things being actually used.
I just wrote (I thought I should remember how to write python) lean-deps
, which you use as follows.
Let's look at the dependency tree for src/category_theory/types.lean
, restricting to import chains ending within src/category_theory
:
$ ./lean-deps src/category_theory/types.lean src/category_theory/ src/category_theory/types.lean ├── src/category_theory/functor_category.lean │ └── src/category_theory/natural_transformation.lean │ └── src/category_theory/functor.lean │ ├── src/category_theory/category/default.lean │ └── src/tactic/reassoc_axiom.lean │ └── ≪ src/category_theory/category/default.lean ≫ └── src/category_theory/fully_faithful.lean └── src/category_theory/isomorphism.lean └── ≪ src/category_theory/functor.lean ≫
Dependencies which occur multiple times are shown wrapped in ≪ ... ≫
, and their further transitive dependencies are omitted. (You can omit repeats entirely using lean-deps -o
, or show their dependencies too with lean-deps -a
.
Without a second argument, lean-deps
shows dependencies all the way down. It takes a few seconds on files deep in the hierarchy, but seems usable. You can also specify one or more specific files as second arguments, so we can analyze the somewhat surprising dependency of the Hahn-Banach theorem theorem on the category theory library as follows:
$ ./lean-deps -o src/analysis/normed_space/hahn_banach.lean src/category_theory/category/default.lean src/analysis/normed_space/hahn_banach.lean └── src/analysis/normed_space/operator_norm.lean └── src/topology/metric_space/lipschitz.lean └── src/category_theory/endomorphism.lean └── src/category_theory/category/default.lean
This seems pretty duplicative, of course, with what Patrick has done, but I find the text mode output very satisfying.
I prove that list.prod
of Lipschitz End
s is Lipschitz.
Perhaps we could just combine the two, so leanproject import-graph -from XXX
but with no filename prints an ASCII tree on stdout
Also, I think leanproject import-graph
doesn't yet support using both -from
and -to
, which I think is very helpful for understanding a particular chain.
My code is at https://gist.github.com/semorrison/d27e35ed5eac96b0dec939f72fada56d.
I think I'll stop playing with it until hearing from Patrick.
I think this also duplicates functionality in olean-rs
you have to calculate this info in order to read any lean file
it should be a lot faster than a few seconds too ('cause Rust and all that)
oh I see, you are calling lean a bunch of times to process the files. Yeah, olean-rs
will be a lot faster, since it just does the same thing lean does but without the text processing and elaboration
The dependencies of an olean file are all literally written in the first line
I just want ASCII trees, in a tool whose installation procedure is already covered by pip install mathlib-tools
. :-)
how feasible is it to link an olean-rs library build to a python project? I would guess it's possible, not sure about how distribution works
lean --deps
is much faster than running lean. It doesn't import anything, it just parses the first command in the file and outputs the imported files.
I worked a bit on this, see https://github.com/leanprover-community/mathlib-tools/pull/38/commits/6a94d737f54fd259d7ee228e2ef56b5b4f997a45. The motivation for adding ascii art output is very low for me, but feel free to add a commit to this PR. I also just realized I didn't interpret "support using both --from
and --to
" in the same way as Scott. I added this possibility, but it return the intersection of the subgraphs that each option would have generated, whereas Scott's example suggest generating only the shortest path from one file to the other. For comparison, here is the current output of
leanproject import-graph --to analysis.normed_space.hahn_banach --from category_theory.category.default hb.pdf
Note that my version clearly points out the culprit: topology.metric_space.lipschitz
randomly imports two category theory files.
which are used in three isolated lemmas in the middle of the file.
Is there something bad with importing category theory files?
How else should I argue about long compositions of self-maps?
This was described as "somewhat surprising", not bad (especially coming from Scott).
Then there is the question of optimizing the import graph, but this is a complicated question.
@Patrick Massot, how do I run leanproject
from a branch of mathlib-tools?
I tried:
imports
leanproject.py
in mathlibtools
chmod u+x ...
import: delegate library support not built-in '' (X11) @ error/import.c/ImportImageCommand/1282. ./leanproject.py: line 13: syntax error near unexpected token `(' ./leanproject.py: line 13: `from mathlibtools.lib import (LeanProject, log, LeanDirtyRepo,'
after the usual help text.
Am I meant to instead be using pip
to install the branch version?
(Actually, not after the usual help text: instead it prints help text from ImageMagick...)
Using leanproject
without installing the mathlibtools package is definitely not supported, even when developing it. The correct workflow is
git checkout imports pip install .
If you are modifying it you can pip install -e .
to avoid constantly running pip install
.
The ImageMagick thing is hilarious, I wonder what your shell is trying to launch leanproject.py
directly (this file has no shebang indicating this should be ran using python).
Since you don't seem to be familiar with python packaging, let me point out that the name similarity between the user-facing script leanproject
and the file leanproject.py
is not what create the user facing script, which comes from https://github.com/leanprover-community/mathlib-tools/blob/master/setup.py#L15-L18.
@Scott Morrison what is the status of this thread? Do you still want to contribute to https://github.com/leanprover-community/mathlib-tools/pull/38 or should we merge it?
I added some documentation to what you'd done. My attempts to add text mode output failed, so I added some comments to the PR in case anyone else wants to take this up again.
I'll use my lean-deps
script myself for the "dependencies between X and Y" question.
I still don't understand the specification here. What do you mean by "dependencies between X and Y" ? Why isn't my version the answer?
Remember the answer of my version is https://leanprover.zulipchat.com/user_uploads/3121/oMG7VwMiOT61e9YWTIrcskk5/hb.pdf
Oh, I see, that's great. I just never managed to run it locally (because I only worked out today that I needed to install graphviz for anything to work), and missed the link you provided to the PDF.
I saw in the code the line
if to and from_: G = graph.path(start=from_, end=to)
and made an (incorrect) assumption about what it was doing.
topology.metric_space.antilipschitz
imports topology.metric_space.lipschitz
;-)
I'm sorry I thought the doc was clear. Please feel free to clarify it. It's still not quite true that graphviz is required. You can output graphml or gexf and look at them using yed or Gephi for instance.
But it's true you need some graph visualization software to see the graph.
@Scott Morrison what is this timing stuff you added in the import graph branch?
I guess this is a git accident.
git accident!
/me looks it up in the git manual
Ok, I cleanup up and forced push. I'm afraid you lost the authorship here, but I hope it's not too bad.
no worries :-)
{% endraw %}Last updated: Apr 24 2020 at 19:02 UTC


New Saudi Payments Company expected to enhance e-transactions
RIYADH: Saudi Arabia’s Citizen Account Program announced that it had deposited SR2.6 billion ($700 million) for selected beneficiaries for November. Total compensation for the previous instalment, paid retroactively, stood at SR11.4 million. The percentage of eligible beneficiaries for this instalment was 84 percent, which covers more than 12.6 million individuals and entities. The total disbursed payments since the start of the program amount to more than SR58.2 billion.
At least 51 percent of the total beneficiaries received full benefits with average support of SR962 per household.


Rearrange the group teams so the teams you believe will make it out of groups are on top. Each correct pick is worth 2 pts. If you also correctly select which position a team advances in (1st or 2nd) you are awarded an additional point. All group entries must be submitted before the first game (Russia vs Saudi Arabia June 14th at 9:00am MDT).