Browsed by
Month: May 2017

Gradient Descent using Flocking algorithms

Gradient Descent using Flocking algorithms

One of the key mathematical foundations of machine learning is using gradient descent to find maxima and minima in a multi-dimensional data set. Gradient descent is good, but getting the most out of it can sometimes leave you wringing your hands or doing a lot of painful mathematical investigation and analysis. Investigations that can quickly tax even a mathematics major.

Sergui Puscas shows us a different, more intuitive way to find maxima and minima by using swarming and flocking techniques. It’s a pretty fun read.

Atomic Accidents by James Mahaffey

Atomic Accidents by James Mahaffey

This has to be one of the most interesting reads (audiobook listen in my case) I’ve had on the subject of nuclear history. I also think it should be read by every engineer of any background.

Why? Jim Mahaffey, while a Ph.D. in Nuclear Physics and having spent over 25 years in governmental, military, and civilian nuclear projects, presents a narrative that isn’t stilted in the usual pro/anti-nuclear rhetoric. It isn’t trying to scare or discount each event. I found myself captivated for three reasons. Firstly, some of these events and details I had never heard of before. It was fascinating to hear that there was a cave full of natural radioactive ore that sickened some hunters who wandered into it. Secondly, and related, he knows exactly what he’s talking about. He cites the chemistry, physics, and even patent information for everything involved. There is no hyperbole. His information comes from actual studies, chemistry, nuclear physics, and the hard scientific data. Some of the facts in the book I’d never heard anywhere else before. Sometimes I even wondered if he wasn’t leaking secrets.  Finally, he does all this with a captivating sense of storytelling and a fantastically dry sense of humor. I found myself sitting in my car listening to a story finish out – such as when he tells the story of a cable tray fire that breaks out during one particular accident:

“The fire continued to grow so the supervisor ran down the hall and grabbed a larger fire extingisher. He emptied it into the blaze, but the fire was unimpressed.”

The thing that makes this book great is that he isn’t arguing for or against nuclear power. It explains the chemistry and physics of what is going on so well that it removes the fear and terror we often associate with nuclear reactions. So all you are left with are the accidents. Most books of this type would be trying to either scare you or dismiss what happened. This is really unbiased storytelling that does what it should: it doesn’t tell you what to think – it presents all the data and narrates the story so that it makes YOU think. What would I have done? What should be done?

This is why I suggest every engineer read this book. Even if you are not interested in nuclear accidents or nuclear power scares you. It’s not really about that. It’s about the difficulty of engineering – especially engineering where failure means serious consequences. It’s about the traps we as engineers fall into. We can be extremely intelligent and well versed, but get taken out by a simple rat chewing a cable. Instead of telling you what to think, it tells the story. The fact that it deals with energies that can, and have, killed people crystallizes the importance of each design decision. You’ll often see yourself connecting the thought that the designers had with your own engineering principles – and realizing the weak points.

Highly recommend.

 

Spoilers below on what I ‘learned’ – don’t read if you want to come up with your own conclusions

After listening to it on audiobook over the last week or so, I found myself thinking about these topics:

  1. Anything that is foolproof is not. All mechanical systems have a useful lifetime and/or fail at some point. Maintenance doesn’t always happen when it should. Things that fail sometimes take time for people to realize they failed – especially if it is a backup system that is rarely used. People plug things in backward by accident, read the wrong gauge, use the wrong lubricant, etc. You cannot suppose that everything will be maintained as it was when it was perfect and new and the designer is right there watching it.
  2. The weakest system, not the strongest one is all that is needed to start a problem.
  3. In work around dangerous forces, you cannot have an ignorant workforce. People must understand WHY each procedure is there, or they’ll come up with shortcuts that may get themselves or others killed unexpectedly because they’re trying to save time/effort/money/etc.
  4. We should probably not run experiments on commercial reactors/preparation plants. That should only happen in the lab. But there are many ambitious, very smart people that want to make a name for themselves and do things they should not because they believe they are smart enough.
  5. When something must run constantly over a long time – given a long enough timeline – EVERY possible thing will happen. Every possible combination of failures will also happen. You simply can’t imagine it all.
  6. Even when you imagine and prepare for the worst, it can be worse.
  7. Luck plays a big part in disasters. Given exact same plants and the same accident, one will be ok and the other will not because of luck in the smallest detail/timing of how something happens.
  8. Real disasters usually involve 2 or more very unexpected and different things simultaneously going bad or failing in quick succession.
  9. Individual systems that are failsafe on their own can react in unexpected combinations when more than a few things at once start failing. You must look at how the system as a WHOLE handles an event that causes serious single and multiple system failures (i.e. the chocolate cake delivery truck loses its brakes, knocks over a power pole, and then hits the turbine building. It starts a fire that shuts down the turbines. With the external electrical wires down, the lights in the basement of that building go off. Unfortunately, that happens to be where the fire handling equipment is – that nobody can now find in the dark).
  10. You must design things to end in a state after such an event that you can recover from them without endangering lives.
  11. It is often the discounted/seemingly unimportant support systems that cause the accident to become a disaster. While massive amounts of effort are spent understanding nuclear forces and fission, most reactor accidents are caused by things like pump bearing failures, valves that get stuck, emergency generators that don’t kick on because the wiring went bad, or running ill-advised tests.
  12. An unexpected chain of failures is what sometimes causes a disaster. (ex: a failing cable starts generating error messages. The error log starts filling the available hard drive. The drive fills and crashes because nobody thought there would be so many messages. The computer that crashed was also controlling some other subsystem, which now fails too. That causes a bigger failure that leads to a disaster.)
  13. An alarm that goes off all the time is as useless as if it hadn’t been installed at all.
  14. The amount of thought and fail-safes you build must be directly proportional to how bad it will be if it goes wrong. Dropping a jar of tomato juice requires water, a mop, and bucket and buying a new bottle of tomato juice. Dropping a jar of fission products all over the floor is a whole other matter. From isolation, to clean up, to personal safety, to disposal, to handling what to do with the materials, clothes, and items used in the cleanup – all require complete thought and handling.
  15. One must stay a little paranoid and constantly vigilant when working with systems that involve deadly/dangerous forces. A regular schedule of checking and re-checking is the only way to know if things are working as they should. You cannot be laissez-faire until a failure to fix something. Even little anomalies are indications that must be checked out. One must stay curious, regularly check, and fix things that don’t even seem super-important at first. See #2.

Here’s a great example:

A liquid storage tank of olive oil that develops a tiny leak could be bad. You are losing product, money, and might cause an injury if someone slips. It is even worse if it was almost undetectable and goes dripping into the floor drains for weeks, months, or even a year.  It gets even worse when the oil coagulates in the underfloor drains and almost completely plugs them up. Then the 50,000-gallon vat of spaghetti sauce spills and the drains that should have saved everyone don’t work. It causes the spill to go everywhere and gets on everyone. It gets even worse when the sauce ruins tens of thousand dollars of product that was sitting on the floor and destroys electronic machinery drenched in it. It gets even worse when it runs into the basement, filling it 2 feet full of spaghetti sauce. Because of one dripping olive oil vessel, you now have tens of thousands in lost products, people drenched in goo, machinery destroyed, and a basement flooded with a sauce that may take hundreds of thousands to clean up. On top of the fact you can’t make one more jar of the product until it’s all cleaned up.

Now imagine that it was nuclear fission products that dripped. And when enough collects, it becomes an unshielded reactor in the floor that kills anyone that comes near it.

This is why every engineer should read this book. To understand how failures really happen, and why just making an individual system fool proof and having safety systems can be a false comfort. The nuclear world is full of extremely smart people that bragged nothing could go wrong. Humility and diligence are the values we should cultivate.

Those Cool Open Office Spaces are bad for employees

Those Cool Open Office Spaces are bad for employees

From Inc Magazine that is citing the most comprehensive studies done. But this shouldn’t be a shock, many of these studies were done in the 1950’s and came to the exact same conclusions.

And all this after Indie developers are learning to throw out working all the time in favor of actual office hours too. Turns out those ‘big old companies’ are all being proven right. After all, they got the way they are – big, old and profitable – by researching and using the best-known methods.

From the article:

There have been numerous studies showing that open-plan offices are both a productivity disaster and a false economy. (The productivity drain more than offsets the savings in square footage.) There are even some videos showing how wretched (and in some cases ridiculous) these environments truly are.

Well, just in case you weren’t yet convinced, here’s some new evidence from a study of more than 40,000 workers in 300 U.S. office buildings–by far the most comprehensive research on this issue. The results, published in the Journal of Environmental Psychology, came to the following conclusion:

“Enclosed private offices clearly outperformed open-plan layouts in most aspects of IEQ (Indoor Environmental Quality), particularly in acoustics, privacy and the proxemics issues. Benefits of enhanced ‘ease of interaction’ were smaller than the penalties of increased noise level and decreased privacy resulting from open-plan office configuration.”

Don’t let the jargon confuse you. The term “proxemics issues” refers to how people feel uncomfortable when they’re forced into close proximity with other people. To be perfectly clear, here’s what the paragraph says: “Open-plan offices aren’t worth it.”

BTW, it isn’t just the noise and the interruptions that cause people to hate open-plan offices. According to a recent Wall Street Journal article:

“All of this social engineering has created endless distractions that draw employees’ eyes away from their own screens. Visual noise, the activity or movement around the edges of an employee’s field of vision, can erode concentration and disrupt analytical thinking or creativity.”

Unlike noise pollution, which can be remedied with a pair of headsets, there’s no way to block out the visual pollution, short of throwing a towel over your head and screen like a toddler’s play tent.

Why you shouldn’t get your news from Facebook

Why you shouldn’t get your news from Facebook

So where can you get your news? In general, one can start with this chart to know the rough bias of the source:

I usually hit up the BBC for general news, then start cross referencing facts between varied sources on a particular subject to get the spectrum of the ‘facts’. If more than a few jive and come from sources on both sides of the left/right bias line – then I consider it credible. I don’t consider sources more than one tick from center to be credible without serious distortion of the facts.

Facebook posts, however, is news curated by your friends. I love you all, but we’re not the most unbiased nor always check our sources and facts when we post (myself included). I must consider my sources.

The comment chain is where you can lose faith in humanity. Some people like posting inflammatory stuff to “circle their wagons”. These things become pits to vilify others, feel better about themselves, as well as become an echo chamber to entrench and deepen their own opinions. I’ve seen downright sexism, racism, threats and recommendations of violence spewed from people on both sides of the far right AND left of the political spectrum. If you’re one of these people – it’s time to check yourself. If your posts are nothing but hate, rejoicing in the destruction of others, and tirades of outrage – you are not helping.

These comment chains are like nuclear reactors. You take enough radioactive material of the same kind together, and on its own, just being close to more of itself, it turns into lots of heat, pressure, and radiation that kills anyone coming near it. The end result is to make everyone reading it more polarized as your circle of ‘yes men’ entrenches – because you’re no longer being challenged to deal in a civil way with others that disagree with you. Not that things aren’t wrong. They are. But a real effect of this last election has been to damage genuine dialog that seeks to understand the other, learning how to make convincing arguments that respect others and might actually change the mind of a reasonable person via facts and logic or building bridges between people that disagree. If you truly no longer believe that’s possible, then please make some effort or find those to help because the other logical courses of action (besides talking) are destruction.

We can still have a very strong personal identity and mission. But just as the bias of these news sources – the way we convey even actual truth can take perfectly good news and make it completely useless or even wrong. Exercise: Take one actual event and find it on each of these sites. Witness how they change wording, titles, and commentary from far left to far right. It’s a fascinating exercise each of us should do. I often challenge myself by going left/right to see the opposite spin – the goal is learning how to listen to a take I don’t agree with but not flip out.

Being outraged is easy. Being angry is easy. Wanting to hurt others or see them hurt is easy. It is harder to use your brain. It’s harder to build a common good. If an article makes me incensed or angry, my ‘Am I being played?’ light comes on and I go to more sources. I practice not immediately been swept up (which makes you easy to control), but to internally learn how to question or make meaningful counter-arguments.

If you believe you’re ‘open minded’ because you consider yourself a Democrat/left-leaning/etc – then I’ll challenge you with the fact I’ve read at least one person I know here in Portland that claimed all these things yet believes they have a right to use whatever means (even physical violence) without punishment because ‘those people are just wrong and I need to resist with everything I have.’ Violence begets more violence – and only makes whoever is physically stronger and willing to do what others won’t ‘right’.

If we can’t learn how to get along and civilly dialog with those we don’t agree with – then we have no hope as a nation nor as a people looking for the common good. As my old history prof said, “Democracy is not about getting everyone to agree – that will never happen. What it does is give us a form of government in which everyone gets some of what they want – enough to get along – without having to kill the other side like we did for millennia.”  Instead, we are headed back to that attitude if it increasingly becomes all about ‘me’. It doesn’t help that our news has learned that outrage sells and fuels the idea of all-or-nothing ideals using inflammatory headlines. If we continue, we will pick even more and more radical people to lead us to our own destruction. All the while controlled and directed by a steady and constant fuel of ‘outrage’ that makes us act emotionally, not with our brains.

It is also not Christian. God does not delight in the death or destruction of even one sinner:

I tell you that in the same way there will be more rejoicing in heaven over one sinner who repents than over ninety-nine righteous persons who do not need to repent. – Lk 15:7

Christ came not to judge the world, but to call all to himself:

For God did not send his Son into the world to condemn the world, but to save the world through him. Whoever believes in him is not condemned, but whoever does not believe stands condemned already because they have not believed in the name of God’s one and only Son. This is the verdict: Light has come into the world, but people loved darkness instead of light because their deeds were evil.  Everyone who does evil hates the light, and will not come into the light for fear that their deeds will be exposed. But whoever lives by the truth comes into the light, so that it may be seen plainly that what they have done has been done in the sight of God.. – Jn 3:17

If our job is to continue the work of Christ, we do the same. We do not judge nor condemn but spread the good news. The news each can live in the light and truth without shame. That we do not need to live in the darkness of our past. It can be brought out and healed. We can live free from the darkness of the evil in our lives. Evil has a way of hurting us so that our decisions in the future are tainted by hiding from, or hiding the shame, of that hurt. It breaks up our relationships. And in the light, even if we fall again, that darkness can be healed and forgiven. Nobody is beyond forgiveness. Nobody is beyond hope.

Everything is its own reward

Everything is its own reward

From the book “Everything is its own reward” by Paul Madonna

In hard times, beauty can seem frivolous – but take it away, and all you’re left with – is hard times.

All the places we went.
things we did.
At one point I tried to arrange them,
construct some sort of narrative.
I was looking to find sense in what happened,
fully believing I could.

The days passed slowly, while they years flew by.

Leave a little emptiness
A space
for when what you’re waiting for
arrives.

Right now I’m so damn happy. And I’ve been alive long enough to know it’s all so damn fleeting.

Everything is its own reward.

I kept meeting people that claimed to be artists but never made anything. Always the same excuses: time, money, space. So I decided I’d use only supplies that fit in my backpack. I could draw and write anywhere, anytime, so if I didn’t, I’d be to blame.

In this episode, Michael attempts to construct a time machine to escape debt and dinner party obligations.

He said the only things he regretted was having not written down all the excuses people had given him for not doing whatever it was they had said they would do. “Priceless insights! With them, I could’ve held a mirror to the world”

The portions of his brain not used to imagine her in compromising positions

“What? I didn’t say anything.” “You didn’t have to, you’re saying it in my head.”

He was like a shark of conversation – if he stopped talking he would die.

Words spoken then forgotten
turn up again like tiny shards of glass
from broken bowls
hidden in the rug missed by the vacuum
pierce your toes in the early hours of the morning
as you wander the hall
wondering why it is you can’t sleep

There had been a confrontation followed by a cooling off period. Memories became distorted, imaginings of what could have happened grew exaggerated. It’s what happened in absence, and the longer it went on, the greater the crash that would come from giving it another try. It was like trying to correct your posture. You know that you slouch, so you straighten your back and vow to forever sit up right, only to find a moment later, you’re hunched over again.

It despairs her to know that the world is not flat. That if she sailed off one shore, she would hit another. That she can’t just keep … going.

Sometimes I pack a bag and just walk around the neighborhood.

You were starting to have second thoughts about all the friends who complimented you on being self-deprecating.

There will always be someone who walks into the middle of the street then curses at the cars that have to screech to a halt to avoid hitting them.

They change the definitions of words you believed in slowly, so that what you ended up fighting for was the opposite of what you wanted.

Freedom to act outside the rules is no protection against doing so.

and in my head, I go.

What about those thoughts that say you can do anyeverything?

I am not an industry

I’ve found my hand, but not my voice.
I’ve begun to make my name, but not my fortune.

All my offerings of beauty are little more than decoration
If through them my demons are not set free.

What are you looking to get? To give? What will help you feel closer to whatever it is you feel far from?

It takes perpetual work to keep life simple. There are ways of being that I could return to, but they’d result in little but trouble.

“I think that’s the first thing to rule people out, whether they’d still do it if there was no money.””Reality doesn’t have to be like that.”

“Reality doesn’t have to be like that.”

There are so many things I can do – so I don’t do any.

We want something to tell us how to live (that doesn’t mean we’ll listen)

Are you really sorry, or is that just what you tell people when you can’t tell them the truth?

Revisit old themes

Does the smell of the air today remind you of another time? Inhale through your nose. And the next time a day like this comes around you’ll be transported back to now.

“All this wondering why,” she says. “It’s a pain. Makes you think you’re doing something important, that you’re smart or covering all your bases, when all it does is spin you in ever darkening circles. I’m convinced that why is no longer the question – or the answer. Maybe I’m just progressing through interrogatives, but at this point, the question I’m asking is, how?”

How do you get smarter faster?

How can you know what you don’t know?

I walk around – Touching everything I love once.

Changing because you were caught doesn’t make you honest
Changing because you were forced to confess and now live under watchful eyes doesn’t make you fixed.
Change because you can’t live being who you are – and change alone.

No matter which direction you choose, in 5 years you’ll be happy you did.

We were talking about how you can’t make decisions out of fear, or potential discomfort. That if you do, you don’t really ever go back.

There is a fine line between inconvenience and hardship

In what country do you live? What home?

You got older, and things happened (all windows of the cars on you street got smashed out)

Rich said he felt better after a friend told him, “Everyone has a box for problems in their heads, and no matter what’s going on in your life, the box will always be full.” It made me feel better too – so I’m passing it on.

Trying to turn the disillusionment into cash

All weird camera angles – And no story

I listened to the news of the world too early and so the rest of the morning I walked around feeling that everything was bad. Then through a store window I saw a book of drawings I just had to have. They made me happy so I bought them. Out on the sidewalk I realized that the only thing I can do about the state of how people have to live is offer what I can, whatever I have to offer, and go from there.

eDNA, biodiversity, and the end of brutal field work

eDNA, biodiversity, and the end of brutal field work

I heard a fascinating news clip while listening to BBC radio.

When one wants to study a species and how it is doing or get an idea of what animals live in an area, one usually must spend untold hours in field work. Scientists must come up with clever ways to detect the animals they are tracking, get counts, and collect all kinds of other data. This work is often tedious, expensive, and error prone.

But there is a new technique exploding on both land and sea. It’s called eDNA.

Environmental DNA (eDNA) is a technique that involves simply collecting water or soil samples, then sifting it for DNA. Every living thing sheds DNA into the environment in many ways: skin cells, waste material, hair, scales, etc. Each of these materials has cells, and each of these cells has mitochondrial DNA that identifies the species.

Now, instead of spending long hours trying to canvas areas over long periods of time to see what animals are present, you can simply take a few soil or water samples, and search them for the different species that have been there. Even more amazing, in areas where the mitochondrial DNA doesn’t break down quickly, you can even get a picture of how many kinds of animals lived there in the past.

The technique is perfect for identifying changes in biodiversity. If repeated samples are taken over time, they can tell you if animals are appearing or disappearing from an area. If you want to see if an animal is migrating through an area, simply take samples and see if they appear/disappear at certain intervals.

There are some limitations. You cannot identify individual animals nor get an idea of how many of a particular species are present. Subspecies might have the same mitochondrial DNA and cannot be individually distinguishable.

Still, this is an amazing new technique that will likely revolutionize field work. I’m excited to see what it tells us.