Citizenship in a Republic By Theodore Roosevelt (1910)

Here there are some quotes from the Citizenship in a Republic By Theodore Roosevelt that I found were worth keeping and reflecting upon. Each of the following paragraphs represents a segment.

It is not the critic who counts; not the man who points out how the strong man stumbles, or where the doer of deeds could have done them better. The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood; who strives valiantly; 10 who errs, who comes short again and again, because there is no effort without error and shortcoming; but who does actually strive to do the deeds; who knows great enthusiasms, the great devotions; who spends himself in a worthy cause; who at the best knows in the end the triumph of high achievement, and who at the worst, if he fails, at least fails while daring greatly, so that his place shall never be with those cold and timid souls who neither know victory nor 15 defeat. Shame on the man of cultivated taste who permits refinement to develop into fastidiousness that unfits him for doing the rough work of a workaday world. Among the free peoples who govern themselves there is but a small field of usefulness open for the men of cloistered life who shrink from contact with their fellows. Still less room is there for those who deride of slight what is done by those who actually bear the brunt of the day; nor yet for those 20 others who always profess that they would like to take action, if only the conditions of life were not exactly what they actually are. The man who does nothing cuts the same sordid figure in the pages of history, whether he be a cynic, or fop, or voluptuary. There is little use for the being whose tepid soul knows nothing of great and generous emotion, of the high pride, the stern belief, the lofty enthusiasm, of the men who quell the storm and ride the thunder. Well for these 25 men if they succeed; well also, though not so well, if they fail, given only that they have nobly ventured, and have put forth all their heart and strength. It is war-worn Hotspur, spent with hard fighting, he of the many errors and valiant end, over whose memory we love to linger, not over the memory of the young lord who “but for the vile guns would have been a valiant soldier.”

He must pull his own weight first, and only after this can his surplus 35 strength be of use to the general public. It is not good to excite that bitter laughter which expresses contempt; and contempt is what we feel for the being whose enthusiasm to benefit mankind is such that he is a burden to those nearest him; who wishes to do great things for humanity in the abstract, but who cannot keep his wife in comfort or educate his children.

That is why I decline to recognize the mere 45 multimillionaire, the man of mere wealth, as an asset of value to any country; and especially as not an asset to my own country. If he has earned or uses his wealth in a way that makes him a real benefit, of real use- and such is often the case- why, then he does become an asset of real worth. But it is the way in which it has been earned or used, and not the mere fact of wealth, that entitles him to the credit. There is need in business, as in most other forms of human activity, of the great guiding intelligences. Their places cannot be supplied by any number of lesser 5 intelligences. It is a good thing that they should have ample recognition, ample reward. But we must not transfer our admiration to the reward instead of to the deed rewarded; and if what should be the reward exists without the service having been rendered, then admiration will only come from those who are mean of soul. The truth is that, after a certain measure of tangible material success or reward has been achieved, the question of increasing it becomes of constantly 10 less importance compared to the other things that can be done in life. It is a bad thing for a nation to raise and to admire a false standard of success; and there can be no falser standard than that set by the deification of material well-being in and for itself. But the man who, having far surpassed the limits of providing for the wants; both of the body and mind, of himself and of those depending upon him, then piles up a great fortune, for the acquisition or retention of which he 15 returns no corresponding benefit to the nation as a whole, should himself be made to feel that, so far from being desirable, he is an unworthy, citizen of the community: that he is to be neither admired nor envied; that his right-thinking fellow countrymen put him low in the scale of citizenship, and leave him to be consoled by the admiration of those whose level of purpose is even lower than his own.

My position as regards the moneyed interests can be put in a few words. In every civilized society property rights must be carefully safeguarded; ordinarily, and in the great majority of cases, human rights and property rights are fundamentally and in the long run identical; but when it clearly appears that there is a real conflict between them, human rights must have the upper hand, for property belongs to man and not man to property.

The citizen must have high ideals, and yet he must be able to achieve them in practical fashion. No permanent good comes from aspirations so lofty that they have grown fantastic and have become impossible and indeed undesirable to realize. The impractical visionary is far less often the guide and precursor than he is the embittered foe of the real reformer, of the man who, 5 with stumblings and shortcoming, yet does in some shape, in practical fashion, give effect to the hopes and desires of those who strive for better things. Woe to the empty phrase-maker, to the empty idealist, who, instead of making ready the ground for the man of action, turns against him when he appears and hampers him when he does work! Moreover, the preacher of ideals must remember how sorry and contemptible is the figure which he will cut, how great the damage that 10 he will do, if he does not himself, in his own life, strive measurably to realize the ideals that he preaches for others.

Conspicuous consumption

The fusion of both words, conspicuous consumption, is a term coined by Thorstein Veblen in 1899 but it is easily applicable to modern society. It is an economic theory that does not shine optimism. Based on the meaning of the words separately Conspicuous: Attracting notice or attention. Consumption: The action of using up a resource. Put together, conspicuous consumption refers to buying expensive goods to display wealth rather than covering the real consumer needs.

This economic theory criticizes the industrialized societies where the individuals buy their items based on the status that would provide rather than the utility of them. This, in consequence, leads to a waste of time and resources with the sole purpose of emulating the pertinence of a given social class. If we look into it, we’ll see that recent economic catastrophes have been caused by people trying to be. In 2008 the market crashed because lots of people were over-leveraged to buy bigger houses while trying to keep up with the Joneses. People buy things because their neighbors or acquaintances bought something rather than the utility and profit they can extract from the purchase.

If we look at it critically, conspicuous consumption is the cause of the current health crises where most of American adults are obese. Humans only need a certain amount of food per day, if we overdo it regularly it can lead to health problems. Overeating can cause obesity at the start, but it can also lead to diabetes and coronary diseases. That simply because we are eating more than we should.

Overbuying food has also environmental implications. We live in a society that trows away more food than ever. With proper management of the resources, the world would be more balanced on caloric intake. Low-income countries would have enough to feed their inhabitants; thus giving equal opportunities to many people. But this goes further than our day to day activities. It is not about objects. It can refer to non-material elements. It is not cool anymore to go to the beach one week in summer, this vicious circle expands. Now people have to go regularly to different European capitals and during summer one should visit exotic sunny places. Chilling at home does not display enough wealth.

Leisure is also affected by conspicuous consumption. Conspicuous leisure is about taking part in leisure activities with the sole purpose of displaying status. The activities should be displayed in order to demonstrate idle time as a sign of wealth where the worker would have little time for non-productive endeavors whereas wealthy people would have plenty of time to pursue non-productive activities.

All of which leads to Veblen goods. Those are goods where their demand increases with price. Traditionally it is assumed by economists that demand decreases proportionally to the price increase (and the other way around). But Veblen goods have a complete opposite demand curve. When the price increases the demand increases as well, going against all common sense.

Do we still think that growth is the way to go?

The new software: Advantages and disadvantages

Recently I published a post about the new software paradigm. The new paradigm of software is the one that the coder does not directly program each of the cases for any of the given inputs. The new paradigm uses training data to let the computer learn the outputs for each input. The computer programs itself while the coder and the software developer’s job is to prepare the data and set the target. The new paradigm seems to bring new challenges that need balancing. It has, like everything, some advantages and disadvantages.

On the advantage side, deep learning requires easier hardware. Even though deep learning is more complex than traditional software, neural networks only consists of two basic operations: matrix multiplication and thresholding. Traditional software has many more basic operations like conditionals, loops, etc. Because of that traditional CPUs are required to be able to run many more distinct operations increasing the overall complexity of the hardware. Where traditional software uses CPUs, deep learning uses GPUs. GPUs are developed to perform matrix multiplications making them ideal for neural networks.

Since deep learning is inherently less complex on hardware, one could easily embed already trained models into chips to perform certain tasks. This will make chips low power and specifically designed for defined tasks. If the task at hand is better defined and specific, hardware can be developed so that it is more efficient making it prone as well to scale economies. Imagine a manufacturing chip that performs speech analysis. In a way, this is more portable than code. The code often needs to be recompiled on the system to ensure that works and has optimal performance. A chip would have everything integrated from the microphone to the model.

Once the neural network is trained. Execution time and memory use are constant. Deep learning prediction only requires one forward pass which always requires the same amount of operations and memory. Traditional software different branches of the code require different amounts of resources which leads to a wide range of execution times and resource consumption (i.e. memory allocation). At the same time with traditional software, the branching adds complexity for the developer to not forget any case open, untreated, or even an infinite loop. An infinite loop of the traditional software would render the program unresponsive for eternity. This specific bug does never happen in neural networks.

Contrary to the traditional software that remains untouched for most of their life, deep learning models have the ability to evolve, mutate, and mature to reach and maintain the global optimum. In traditional software calls, APIs, and modules are created alone and die alone. Unless changed software stays the same forever. In this new paradigm, your call helps the model to find a better solution, and be faster and therefore adapt and improve. The more use the better the whole system becomes. You browsing through the internet would help to build a better internet. This software would learn from usage.

Even though there are instances where certain coders would be able to write better code than deep learning, in general, neural networks are better pieces of code. The same holds for high- and low-level languages. Even though most coders do a good job programming high-level languages and let the compiler do their magic, there is an extremely small fraction of people that are able to tune assembly instructions to improve the performance. Small local improvements do not reflect global gains.

But not everything that glitters is gold. Neural networks may be able to achieve 99% accuracy but it may be impossible to understand how this is reached. In some cases, a 90% accuracy that humans comprehend may be preferable. This is a tradeoff that should be assessed case by case. Would you rather get a treatment 99% certain without knowing what is it, or 95% certain but a doctor can explain to you?

Maybe humans don’t trust machine learning models because they may be picking up biases. If it’s true it is on everyone’s best interest to prevent that. It’s in humanity’s best interest that technology remains neutral. But this may be harder than we thought. Microsoft trained a twitter bot on twitter and it turned out to be racist, the reason is that some data cleaning is required, not everything has value. And amazon built a misogynist HR algorithm because they have biased data to start with. So it turns out that machines reflect what’s there without the power to argue against it.

In a way we want the machines to judge the outputs. For everyone’s comfort maybe we should be supervising all algorithms. Deep learning will provide an answer to the data. It may not always be the right answer, but sometimes it may be so wrong that a person will easily pick up. Models do not tell you when they don’t know, if it was not properly trained on specific regions of the data it will provide an embarrassingly wrong result.

Malicious people may use this lack of judgment to benefit from AI. This new software will require new security measures. Attacks against neural networks are different in nature than the attacks that can be done on traditional software. Misleading is as easy as finding a way to mislead the algorithm. If they are somehow public it’s a matter of time until somebody realizes that some tweaks produce vastly different results.

This new paradigm will require new tools. The old software needed debuggers, profilers, and IDEs. The new paradigm is done by accumulating, cleaning, and processing datasets. The new debugging will be done by adding new data with the labels the model fails to recognize. The IDEs may show the model architecture, the training data, and labels but it may also show which data points may be relevant to include so that the model gains certainty on the prediction. Maybe the new era Github is about datasets and trained models.

The new software: Less coding more data

Software like everything is evolving but it is evolving differently than I thought. When I was studying computer science at the university I thought that the future was parallelism. We were taught only one class in parallel programming. Multi-core computers were on the rise and it seemed to be the thing to learn. Since then my opinion has changed. There is indeed the need for parallel programmers but it is not as big as I had foreseen. Most of the libraries and already implemented code that needs parallel programming are already implemented. Some basic notions are required and every now and then.

They also teach “sequential” (regular) programming at the university. Regular programming until now is about giving specific instructions on what actions the program should take. Each line of code contains a specific instruction with a defined goal. The programmer wrote code indicating at each step which actions the computer had to perform without leaving room for the computer to improvise. All cases are defined in a way or another. If not, the program breaks. This is also true for parallel programming where the code defines the actions to be performed, and in which order. The difference between single-core and multi-core is that single-core executes all the instructions in a sequential manner whereas the multi-core can have multiple executions of different parts of the code that do not necessarily follow the same paths.

On the new paradigm, the one that Andrej Karpathy made me notice, and I agree with, software is abstract. Software becomes the weights of neural networks and as humans, we cannot interpret nor program it directly. Therefore the goal in these instances is to define the desired behavior. The software developer should then define that for these sets of inputs we want this other set of outputs. For the program to follow the right behavior, we need to write the neural network architecture to extract the information from the domain and then train it so that the program searches the space for the best solution. We will no longer address the complex problems using explicit code; instead, the machine will figure out by itself.

Software is certainly changing in a new direction. There are many instances where it may be easier to gather more training data than actually hard coding an algorithm to perform a specific task. In the new software era, the coders’ tasks are to curate the datasets and monitor the system. The system is optimized to perform the task in the most accurate manner. “Old school” programmers will be sill in need in the same way there are still people who code for a living on low-level languages. Old school programmers will develop labeling interfaces, create and maintain infrastructure, perform analysis, etc.

Nowadays it is clear that neural networks are the clear winner over hardcoded instructions in many different domains. With the current software, McKinsy states that 30% of companies’ activities can be automated. Machine translation, image recognition, text analysis, and games like chess or even ‘League of Legends’, which requires an advanced understanding of the universe, can be automatized by computers. Google reduced 500 000 lines of code to only 500 from the translate program thanks to TensorFlow and neural networks. These are the classic examples where deep learning is straight forward and can shine but there are other less intuitive (and less sexy) domains where huge improvements can occur like data structures and databases. In this example of not sexy publications, the deep learning software was up to 70% faster and used an order of magnitude less memory than the traditional software. As the last example, I would like to bring this article where researchers brought this idea to the extreme. They created software that does not even require to define the model to be used and instead finds it for the user.

In conclusion, traditional software, the one that we have been using until now, will remain. There are some instances like law and medicine where black-boxes cannot be accepted and won’t be tolerated. Other times it will be more cost-efficient and easy to hard code the features instead of preparing training data and letting the model figure out. The new software era will be the one where coders will not explicitly write the course of action for each case, instead the neural network will find the best solution for a given input. The software will find out the best solution for a given problem without the explicit instructions of a human. The new paradigm software will become more prevalent and along with these lines new software tools will be developed.

Want to reduce the plastic usage? Try the wellness approach

We’ve been facing the problem of plastic usage wrong.
Plastics cannot be recycled [1] and when they can be recycled it is not an easy straight forward process. Yet, everyone is using them out of convenience. They are cheap and nobody cares about the environment when it comes into conflict with their pocket.
The solution? Studies should be found to find if plastics are nocive to human health.
If people worry that they or their kids will get cancer, they may rethink the usage of this material. If something shortens your life expectancy and provides you with a long and awful death people may reconsider buying products that are wrapped with multiple plastic layers.
There is probably going to be part of the population that won’t mind and will immolate themselves. But if consumers have the perception that all that plastic wrapping around food is bad for them it may change more things than telling them to try to reduce plastic consumption.

[1] Hopewell, J., Dvorak, R., & Kosior, E. (2009). Plastics recycling: challenges and opportunities. Philosophical Transactions of the Royal Society B: Biological Sciences, 364(1526), 2115-2126.


Go to the bottom of your SMS and text people regularly something like:
Hi Joe,
It’s Roc here, we haven’t spoken in ages!! I hope you’re fine. What’s the latest with you? No rush on the reply

Don’t skip people
The same for emails. But search for random letters and see what the autocomplete in the “to” field shows.
Look at Linkedin (and other social media) and prise people through a private channel for something they did recently. No likes or comments on the post.
Don’t get discouraged if people take a while to reply or don’t reply at all.
For conferences prepare dossiers about the people you wanna meet so you know their professional side but also the personal one. If you talk hobbies it feels less boring and people may be more engaging and happy to interact.
Always keep a good posture. A trick is to straighten your back every time you go through a doorway.
Ask for help. Ask for introductions for your projects. People can’t read your mind but don’t be pushy.
Tornado technique is an elevator pitch where you say what you can do for others/them. Instead of using the proper definition say what is the goal. I do protein synthesis. It makes no sense for most. Say you create proteins as medicine.
The reverse tornado technique asks what they do for others.
Ask for facts, then emotion and then why as a way to build conversations with people.
If something is obvious maybe ask for some specifics.
Last but not least reduce noise. Look at your calendar the people you met and think if they are high quality or not. And if not limit your interaction.

Convert a mask into a Polygon for images using shapely and rasterio

Sometimes it is necessary to transform masks into polygons to use polygon operations. The way to transform a raster or a binary mask into a polygon is pretty easy. Most of the solutions I found online were the other way (from polygon to a mask). But for my project I needed to convert the mask to a polygon.

Time at Risk

Time at Risk == Value at Risk
(if we replace value by time)

E.g. An insurance company’s 90% TaR is 3 year for liquidity risk
– That means that for 3 years the insurer under the current financial structure would be 90% safe

Time at Risk (TaR for short): is the maximum period of time that an adverse event would not occur. We calculate it as follows:

Incidence rate formula
Incidence rate = \frac{Number of disease cases in a given time period}{Total person time at risk during study period}

The units are cases/person-year