fabiochiu/medium-articles huggingface dataset:
My Recommendations to Learn Machine Learning in Production
Tags: Machine Learning, Data Science, Technology, Artificial Intelligence, Programming

My Recommendations to Learn Machine Learning in Production

Here is a compilation of books, courses, and repositories to get you started.

For the last couple of months, I have been doing some research on the topic of machine learning (ML) in production. I have shared a few resources about the topic on Twitter, ranging from courses to books.

In terms of the ML in production, I have found some of the best content in books, repositories, and a few courses. Here are my recommendations for learning machine learning in production.

This is not an exhaustive list but I have carefully curated it based on my research, experience, and observations.
WAY TO SOUL…
By: Mahnoor Chaudhry
Tags: Soul Searching, Soul, Sufism, Articles, Writing

I plucked my soul out of its secret place,

And held it to the mirror of my eye,

To see it like a star against the sky,

A twitching body quivering in space,

A spark of passion shining on my face.

And I explored it to determine why

This awful key to my infinity

Conspires to rob me of sweet joy and grace.

And if the sign may not be fully read,

If I can comprehend but not control,

I need not gloom my days with futile dread,

Because I see a part and not the whole.

Contemplating the strange, I’m comforted

By this narcotic thought: I know my soul.

Claude McKay

Ever you think about your inner? Ever you think about who you are? Ever you try to find out what is the purpose of life? Ever you try to find out your soul? Ever you try to listen to your inner voice? May be yes, or maybe not. We are born and then die. That’s the whole story. But the era between birth and death is what we earn.

We were born innocent but died, the devil. Do you ever think, why we don’t die virtuous?

We as a human, filled with lots of wishes, needs and dreams. We fight for them to accomplish our goals. We are ready to get our desires at any cost.

We fight to be superiors from others. We fight to be rich. We fight to let others down. When we get all, in the end, we don’t get peace and joy that we were expecting.

Do you know why this happens? It’s because we didn’t know that we actually want to know our inside. Everything else is just an illusion.

The purpose of our life to come on the earth was to find ourself, to find our soul, to listen to our inside voice. when we go far from purpose, achievement doesn’t make us happy.

Everyone has different priorities. Many people get comfortable with materials but the real one who has the curiosity of destiny can’t be ok having materialistic things. They are people who are following the voice of their soul.

About the voice of the soul, many Sufi told their point of view. From Sufism, we can find many things about the soul. Sufi people are not a different creature. They are human-like us but they are said to be Sufi on the basis of their way of thinking.

Yes, exactly way of thinking is a measure that makes a person different from others. What I think is, no one can be superior or inferior on the basis of material things but the way they think. Good thought leads towards good deeds and bad thinking make a human, demon.

Yes, this is the only tools to measure superiority or inferiority. Thinking is also a path to reach the soul. It’s also an ear podcast to listen to soul’s voice. It’s also a lesson to find out the purpose of our being.
I’m Afraid of the Deep South
By: Lindsey, Lazarte
Tags: Self-awareness, Self, Diversity, Culture, America

Having a majority of friends who are white, there’s always been someone I’ve known who’s raved about their vacations going to one of the Southern States, such as South Carolina or Georgia or West Virginia.

They’ve either taken a family trip or went to a bachelorette party or just took a long weekend there. And I’ve heard so many good things about those trips.

But, it’s always from the perspective of a white person.

So, all I think about whenever I’ve heard about those trips is, “But, what would it be like for me?”

“Would people stare at me because I’m not white?”

“Would anyone down there make a racist comment?”

And as much as I’d love to take the leap of faith in testing out the waters for myself and finally paying the South a visit, I still can never shake the fear that it won’t as great of an experience as I’ve heard about from other people.

Instead of the fun trips, I fear of the other stories. The racist encounters. The discrimination. The lack of diversity. The fact that my sister told me about the time she went on a family trip with her friend as a teenager and her relatives couldn’t figure out what kind of Asian she was because they assumed that all Asian people were Chinese.
Binary Tree. Trees are data structure which are of…
By: Abhimanyu Dwivedi
Tags: Python, Binary Tree Traversal, Python3, Binary Tree, Programming

Fig. A sample binary tree.

Trees are data structure which are of hierarchical order and every node, called a parent node, can have zero to many child node. A binary tree is a type of tree in which every parent node has at most two children.

Traversal of Binary Trees:

There are three ways to traverse a binary tree. We can also use them , with few modification, to traverse other type of trees. They are namely along with the parent-child configuration:

1) Inorder Traversing — — Left child/ Parent / Right child

IMPLEMENTATION — -

class Node: def __init__(self, value): self.left =None self.val = value self.right = None def inorder(root): if root: inorder(root.left) print(root.val) inorder(root.right)

2) Preorder Traversing — — Parent / Left child / Right child

IMPLEMENTATION — -

class Node: def __init__(self, value): self.left =None self.val = value self.right = None def preorder(root): if root: print(root.val) preorder(root.left) preorder(root.right)

3) Postorder Traversing — — Left child / Right child / Parent

IMPLEMENTATION — -

class Node: def __init__(self, value): self.left =None self.val = value self.right = None def postorder(root): if root: postorder(root.left) postorder(root.right) print(root.val)

Time complexity in traversing is O(n).

The total number of nodes in a tree:

Below is a given script to find the total no. of nodes in a binary tree:

class Node: def __init__(self, value): self.left = None self.value = value self.right = None def total_nodes(root): if(!root) : return 0 else : return 1+total_nodes(root.left)+total_nodes(root.right)

Total number of possible trees:

Formula to find total number of unlabelled binary trees when “n” nodes are given:

Fig. Formula for unlabelled

Formula to find total number of labelled binary trees when “n” nodes are given:
Swipe to Refresh .. not showing. Why?
Tags: Android, AndroidDev, Android App Development, Mobile App Development, Android Development

This is a quiz for you (with Answer beneath).

I have the following codes for my Swipe-to-Refresh. But there’s one problem. Whenever I perform a network call that invoke showRefreshProgressBar(), the swipe-to-refresh icon didn’t show. Normal user swipe-to-refresh works.

Can you find out why? (Stackoverflow doesn’t have the answer for it).

// Initialize my Swipe-to-refresh to perform the Network Service

private void initSwipeToRefreshView() {

swipeRefreshLayout.setEnabled(shouldEnablePullToRefresh());

swipeRefreshLayout.setOnRefreshListener(

new SwipeRefreshLayout.OnRefreshListener() {

@Override

public void onRefresh() {

beginNetworkService();

}

}

);

} // Call when the a network service is invoke. We should disable

// further swipe-to-refresh since we don't want a double network

// call

public void showRefreshProgressBar() {

if (swipeRefreshLayout != null &&

!swipeRefreshLayout.isRefreshing()) {

swipeRefreshLayout.post(new Runnable() {

@Override

public void run() {

swipeRefreshLayout.setRefreshing(true);

swipeRefreshLayout.setEnabled(false);

}

});

}

} // Call when the a network service is done. We should re-enable

// swipe-to-refresh as now we allow user to refresh it.

public void hideRefreshProgressBar() {

if (swipeRefreshLayout != null &&

swipeRefreshLayout.isRefreshing()) {

swipeRefreshLayout.post(new Runnable() {

@Override

public void run() {

swipeRefreshLayout.setRefreshing(false);

swipeRefreshLayout.setEnabled(true);

}

});

}

}

The Answer

Apparently, swipeToRefresh.enable(false) will reset everything and clear the animation and it’s visibility. The code as below

@Override

public void setEnabled(boolean enabled) {

super.setEnabled(enabled);

if (!enabled) {

reset();

}

} void reset() {

mCircleView.clearAnimation();

mProgress.stop();

mCircleView.setVisibility(View.GONE);

setColorViewAlpha(MAX_ALPHA);

// .... More Codes

}

So, to fix my problem, just fix the second function by swapping the position of setEnable and setRefreshing.
Use React Router Link with Bootstrap
By: Manish Mandal
Tags: React, Reactjs, Bootstrap

Today we will see a simple tutorial on how to use react-router Link with bootstrap. This is a simple tutorial but still, it’s useful because if we replace the Nav.Link tag or Navbar.Brand of react-bootstrap with Link tag of react-router it will remove the CSS associated with that Nav.Link . So let us see how to use that.

This tutorial requires you to have knowledge of implementing react-router and react-bootstrap in your react project. If you don’t have any idea then you can read my previous tutorial on How to use React Router in your React js project and Integrate bootstrap to your React js application

Requirements

I have created a basic react setup with three components header, service, and about. After that created a route for home, service, and about.

3. Now open our header component and add the navbar from react-bootstrap. This is how it will look before any changes.

4. Now install the react-router-bootstrap.

yarn add react-router-bootstrap

5. Now import LinkContainer from react-router-bootstrap.

import {LinkContainer} from 'react-router-bootstrap'

6. Now wrap the react-bootstrap element you want to use with a Link tag like this.

<LinkContainer to="/service">

<Nav.Link>Service</Nav.Link>

</LinkContainer>

So basically <Nav.Link>Service</Nav.Link> now becomes <LinkContainer to="/service"> <Nav.Link>Service</Nav.Link> </LinkContainer> same for Brand <Navbar.Brand href="/">React Bootstrap</Navbar.Brand> now becomes <LinkContainer to="/"> <Navbar.Brand>React Bootstrap</Navbar.Brand> </LinkContainer>

7. Here how it will look after changes in your header component.

8. Refresh your browser to see changes.

Below are the Github repository and live code for reference.
The Practical Side Of Surrender
By: Jordin James
Tags: Inspiration, Life Lessons, Psychology, Poetry, Blue Insights

Photo by SAMANTA SANTY

I wonder if I am getting too happy.

I wonder if I am eating too much or too little.

I wonder what it would be like to just let these wonderings be.

Because sometimes I am too happy

And sometimes I am too sad

And too fearful

And too angry

Sometimes I eat too much

Sometimes I eat too little

Sometimes I self sabotage

Sometimes I show up for myself

Sometimes my heart breaks from pain

Sometimes my heart breaks from pleasure

It all ebbs and flows

Sometimes I have control

Sometimes I really don’t

“Let it be”

Whispers a still small voice inside

Let it be.
How to Split a Large Excel File Into Multiple Smaller Files
By: Songtham Tung
Tags: Startup, Work, Data Science, Bash, Programming

Let’s Get Started!

The first thing you need is an Excel file with a .csv extension. If you don’t have one ready, feel free to use the one that I prepared for this tutorial with 10,000 rows.

The second thing you need is the shell script or file with an .sh extension that contains the logic used to split the Excel sheet. I’ve shared the shell script below, which you can either download or copy and paste into a text editor. If you choose the latter, be sure to save it as split_csv.sh .

There are two important things to note here:

Line 2 contains the FILENAME you can change to match your own.

you can change to match your own. Line 4 contains the number of rows you want to split. In this example, the shell script will split the Excel file into smaller ones containing 1,000 records each.

Great! Now that we finished preparing both the sample Excel file and the shell script, the next step is to execute.
Prepare your list of 3
By: Daniel Morales
Tags: The Mom Test, Challenge Of The Day, Bookcademy, Challenge Of The Week, Startup

Prepare your list of 3

The Mom Test by Rob Fitzpatrick

Solve challenge here: https://www.bookcademy.com/home/show_daily_challenges/prepare-your-list-of-3

Pre-plan the 3 most important things you want to learn from any given type of person (e.g. customers, investors, industry experts, key hires, etc). Update the list as your questions change.

Pre-planning your big questions makes it a lot easier to ask questions which pass The Mom Test and aren’t biasing. It also makes it easier to face the questions that hurt. When we go through an unplanned conversation, we tend to focus on trivial stuff that keeps the conversation comfortable. Instead, decide on the tough questions in a calm environment with your team.

Your 3 questions will be different for each type of person you’re talking to. If you have multiple types of customers or partners, have a list of each.

Don’t stress too much about choosing the “right” important questions. They will change. Just choose whatever seems murkiest or most important right now. Answer those will give you firmer footing and a better sense of direction for your next 3.

Knowing your list allows you to take better advantage of serendipitous encounters. Instead of running into that dream customer and asking to exchange business cards so you can “grab a coffee” (exactly like everyone else), you can just pop off your most important question. And that goes a long way toward keeping it casual.
Ode to the Playful Mind
By: Jac Gautreau
Tags: Play, Poetry, Youth, Art, Creativity

A meditation on the pleasures of a playful mind

One not concerned with the where and the when

But seduced by the how and the why

A cat and mouse curiosity

Where fact begets finding

Where the rules and the points don’t matter

Your move, my move, your guess, my guess

A random thought with nothing to prove

A willful, wonderful mess

A finger-painted portrait of desire and delight

A dream of being yellow and round

and shiny and bright

To chose so quickly

That the moment was imperceptible

The green brick on the gray one

The wayward clump of clay

The pipe cleaner that connects time and space

Caught in the vortex of the toilet paper tube

The unfettered mind expands
Why Facial Features Matter in Your Dating and Professional Life
By: Allison Gaines
Tags: Equality, BlackLivesMatter, Psychology, Race, Women

Why Facial Features Matter in Your Dating and Professional Life

Exploring the impact of featurism

Characteristics like your skin tone, hair texture, and facial features reflect unique qualities. Perhaps your wide nose looks like your fathers’, and your kinky, brown hair reminds family members of your mother. People inherit these traits from their parents, but each person is one of a kind. Each face has a story to tell, reflecting a lifetime of experiences and heritage.

Despite natural variances, many white people claim they do not see race. They insist they would never judge someone based on their physical characteristics. However, modern research contradicts their feature-blind declaration. The human brain is hardwired to recognize facial features with very few exceptions.

Some people suffer from prosopagnosia because of damage to their temporal lobe. Unfortunately, this disorder prevents people from identifying facial features, a condition called face-blindness. Unless someone has this disorder or a visual impairment, they can tell the difference between a wide nose and a thin one.

Humans are naturally visually-oriented. More than 50 percent of the cortex processes visual information. First, people see. Then, people think about what they saw. Their brain attempts to make sense of the external world, shaping their sense of reality.

When someone claims they do not see race-defining characteristics like skin color or facial features, their statement contradicts everything we know about the human brain. Modern physiology shows that most humans visually identify facial features. Thus, society should move on to explore the notion of bias in response to these natural variations.

The results showed that both skin tone and facial features independently affected how negatively, as opposed to positively, whites felt toward Blacks using both implicit and explicit measures (Hagiwara, Kashy, & Cesario, 2012).

White people recognize Afrocentric features. Research shows that seeing a Black person elicits negative rather than positive emotions. While many white people want to believe they do not judge based on race, modern research shows most white people feel animosity, instead of love, at first sight.

No matter who a white person marries or votes for, their implicit bias shapes their world view. Facial features matter in professional and interpersonal settings because people develop feelings and make snap decisions based on their first look.
Death Decisions: What’s the Responsible Thing to Do With Our Bodies?
By: Jonathan Kuhl
Tags: Environment, Death, Green Living, Climate Action, Funerals

Death Decisions: What’s the Responsible Thing to Do With Our Bodies?

With a growing population and limited space, it’s time to get serious about corpses.

I recently traveled to Buenos Aires, Argentina, where as part of a guided walking tour of the city, I visited Recoleta Cemetery. Many of the country’s most notable figures are laid to rest at this cemetery, including Eva Peron (aka Evita). The cemetery is filled with ornate mausoleums, designed to impress and signify each family’s wealth and importance.

Wandering through the narrow lanes of mausoleums, I couldn’t resist peering into the crypts. Most featured a front gate of metal bars or glass, both of which made looking in easy. Inside, small altars were flanked by columns of neatly stacked coffins. While some were well-maintained with polished coffins and vases of fresh flowers on the altars, others were in serious disrepair. Inside the forgotten mausoleums, the columns had collapsed, leaving mildew-covered caskets strewn about dusty floors.

Neglected mausoleum at Recoleta Cemetery

It was the neglected mausoleums that got me thinking. As we plan our final resting places, who are they for? For the living, there’s no doubt ego plays a role. People spend small fortunes on their burials. For a mausoleum at Recoleta Cemetery, the price tag apparently runs as high as quarter of a million dollars. In the U.S., the median cost of an adult funeral with viewing and burial is $7,640, according to the National Funeral Directors Association.

In the face of the finality of death, I understand the impulse to want something to mark that you were here, lived, and are worth remembering. These final resting places also provide a spot for friends and family to visit and pay their respects. But after a few years have passed, I suspect most graves attract few if any visitors. And while the materials selected to construct gravestones are meant to stand the test of time, after a hundred years or so, even the nicest stones start to fade and crack.

If we’re looking at things objectively, and with a healthy dose of humility, isn’t it fair to ask whether cemeteries are an inefficient use of space? In the United States alone, 2.8 million people die each year; which is roughly same size as the population of Chicago. As our population continues to grow, land, especially in urban areas, is a precious resource needed for housing and recreation.

For urban planners, there are interesting solutions from abroad that are worth exploring. In Germany, cemeteries are being repurposed as parks and gardens. In Japan, facilities have been built to store thousands of urns underground. When family members visit these facilities, their loved ones’ ashes are mechanically summoned to a viewing room, and then safely returned underground after the visit has ended. And in London, graves are being reused, and after 75 years of burial if there are no objections, the original casket is lowered deeper into the ground for a new coffin to be placed on top.
Feature Encoding Made Simple With Spark 2.3.0 — Part 1
By: Roshini Johri
Tags: Machine Learning, Pipeline, Spark, Big Data, Feature Engineering

“Every decoding is another encoding” ~ David Lodge

As mentioned in the previous blog, the next few blogs will focus on feature engineering. A lot of work in a machine learning project comes down to it. Whether we like it or not we spend 95% of our time on generating that feature vector that will bring out the best in our data.

Spark provides a lot of leeway on how we can optimize this process. I am going to briefly touch on the types of encoding I’ve found useful and then go more into detail on the problems you might face when using big data. For the purpose of this blog post I assume you have a basic awareness of spark functions and its data types. If not, for a reasonable background understanding, please refer to this documentation.

Pipelines:

I am going to start with pipelines because it makes streamlining your feature transformations easier. The main concept behind pipelines is to combine complex algorithms and transformations to create a workflow. Suppose you have to one hot encode some categorical features and run a xgboost model. You would take the following steps.

Index categorial features

Encode to one hot vectors

Assemble to a feature vector

Train model

These four steps can be run as a sequence of pipeline stages to form a workflow. The data pre processing part will be a bunch of transformers (like the one hot encoder) and estimators that will be fit to the input dataframe. A pipeline object can be created as follows:

Note: the uid here “myPipeline” is optional

Lets see how we can include stages and fit the pipeline model to the input dataframe. We can use one of the feature indexing methods called the string indexer in spark to understand both string indexer and pipelines.

String Indexer:

String Indexer encodes a column of string labels/categories to a column of indices. The ordering of the indices is done on the basis of popularity and the range is [0, numOfLabels). Lets take a toy example of a simple dataframe.
Word Made Flesh
By: Karie Luidens
Tags: Expression, Identity, Tattoo, Illustration, Writing

“I” am a hundred and fifty-odd pounds of warm brain, nerves and crimson blood and sensations running through every inch of me. I am a single pulsing system that is conscious of itself, and of the sunlight, and of the wind hushing and stirring my hair. My body has gut instincts; my emotions live in my lungs, my intestines. My fingertips are the distal ends of my mind.

For years I wanted to celebrate this self by marking my flesh with a tattoo. Its ink would be a declaration of self-possession: “Be warned, world, this body you see is also a mind.”

A tattoo, but of what? Could something as messy as my living, breathing identity have its essence captured in ink?

The question threaded and curled unseen at the back of my mind. Day by day I tried to reason my way through it.
Submit Your Original Writer-Creator Story to the Book Mechanic
By: August Birch
Tags: Writing

This publication is small, but growing daily. I’m building a platform for writers and creators. I need your help (if you’re one of us).

If you’re a writer or creator and you’d like to help other writers or creators sell more stuff, write tighter, write faster, build a platform, grow a course, or share some inside information about the creative process — I’d like to work with you.

Steps:

The first step is to get you added as a writer. Email me your Medium handle and I’ll check out your current work. If I feel you’re a good fit, I’ll email you back and add you to the publication. Email me here: augustbirchthrillers@gmail.com Submit only stories that have not been published. Hit the three dots ‘***’ in the upper-right corner, choose the book mechanic as the publication and hit ‘submit to publication’. Please do not publish the story first. Previously-published stories will not be accepted. Do not send me stories to review in advance. You will not get a response this way. Get added as a writer and submit your un-published content for review

Include your Medium handle in your email or your approval won’t be processed.

Write a unique piece (unpublished elsewhere) and select ‘add to publication’ from the (…) drop-down menu. The Book Mechanic will show up once you’re added as a writer. I’ll read the piece, do any small editing, and punctuation fixes — if necessary. Check your stats. If accepted, your piece will be published in a few days.

Not all pieces will be accepted, but if yours doesn’t, try again. I’m trying to build a valuable resource for vocational, commercial writers.
Stomping Ground
By: Blithe Anderson
Tags: PTSD, Mental Health, Nature, Poetry, Poem

Photo by Tara Robinson on Unsplash

When I jog, I metabolize my grief. It comes out in staccato burps from my heavy chest. “It’s not comfortable, but you can do it.” That’s the eternal message from the cardio gods.

When I was a kid, I left my body during dance recitals and experienced my performance with the audience. I couldn’t take all those eyes. Now it’s part of my daily dance with grief.

The phrase grief-stricken doesn’t really cut it for me. I feel grief-inundated. Grief-blanketed and enclosed. It’s bigger than my body. And it takes up home in my chest.

I’m meeting unknown parts of myself. Mounds of buried humanity. Digging up the soul. It’s an actual gold mine. She is (I am) (We are) entering this world again, foot firmly planted in the soil.

The grass almost glows, it’s so green. Wet earth consumes the heartache. We digest it together; we’re divine female partners. She holds me and I breathe her in.
Why You Shouldn’t Get The Conventional iPad Pro Setup
By: Eva L.
Tags: Technology, Setup, iPad Pro, Apple, iPad

I decided to give Logitech Slim Folio a chance.

It was cheaper than the magic keyboard (about half the price) and it could fold the keyboard away when not in use. I did not take the trackpad version because the whole point of an iPad is the touch screen.

I wanted to love the slim folio but it was hard.

The issues with the Logitech Slim Folio

Image by Author

The case is heavy and bulky, a type of uncomfortable bulky. I understand that the cover is meant to protect the iPad but it is so thick and rough that looks like a binder from the ’90s. The typing experience felt great. However, the keywords were still in between. Even though I could fold the keyboard back when I was not using it, the keyboards would still touch with the back surface. Making it very uncomfortable. There the magnetic flap was always floating around in front of your screen. Ugly and distracting. Again — bad design.

So I returned the Logitech Folio. If you want good protection, good keyboard and do not mind the extra grams. Then I think Logitech Slim Folio is still a good alternative compared to the Magic Keyboard.

Logitech slim folio | Image by Author

My current set up

I went back to the classic foldable case (18€ or $25) and paired it up with a Logitech Multi Device Keyboard K280 for Mac ($39). So far I am very happy with my choice. I spent less than 60€ and have a light, flexible set up.

ESR Rebound Case for iPad Pro 11inch | Image by Author

The foldable case has a standard three-panel folding design which allows me to stand my iPad at multiple angles including reading and writing mode. The cover has a magnetic flap that wraps around my Apple Pencil. The flap attaches to the back when not in used.

The cover I got is very minimal and attached magnetically to the back of my iPad if you are looking for something that gives your iPad more protection but has similar functionality I heard the OtterBox 360 is quite good too.

Logitech Multi Device Keyboard K280 | Image by Author

My keyboard is small and light enough to carry around. The multi-device function allows me to use the keyboard for both my computer and my iPad.

If you do not need the multi-device function and want something lighter I recommend the Logitech Keys-To-Go (only 180g or 6.35oz) which I also have, it is very light and is rechargeable.
Linear regression with TensorFlow
By: Bhanu Soni
Tags: Machine Learning, Data Science, Neural Networks, Artificial Intelligence, Linear Regression

Linear regression with TensorFlow

Using the Matrix Inverse Method

Linear regression may be one of the most important algorithms in statistics, machine learning, and science in general. It’s one of the most used algorithms and it is very important to understand how to implement it and its various flavours. One of the advantages that linear regression has over many other algorithms is that it is very interpretable.

Using the Matrix Inverse Method

we will use TensorFlow to solve two-dimensional linear regressions with the

matrix inverse method.

Getting ready

Linear regression can be represented as a set of matrix equations, say Ax =B. Here we are interested in solving the coefficients in matrix x. We have to be careful if our observation matrix (design matrix) A is not square. The solution to solving x can be expressed as

To show this is indeed the case, we will generate two-dimensional data,

solve it in TensorFlow, and plot the result.

How to do it…

First, we load the necessary libraries, initialize the graph, and create the data, as follows:

import matplotlib.pyplot as plt

import numpy as np

import tensorflow as tf

sess = tf.Session()

x_vals = np.linspace(0, 10, 100)

y_vals = x_vals + np.random.normal(0, 1, 100)

2. Next we create the matrices to use in the inverse method. We create the A matrix first, which will be a column of x-data and a column of 1s. Then we create the b matrix from the y-data. Use the following code:

x_vals_column = np.transpose(np.matrix(x_vals))

ones_column = np.transpose(np.matrix(np.repeat(1, 100)))

A = np.column_stack((x_vals_column, ones_column))

b = np.transpose(np.matrix(y_vals))

3. We then turn our A and b matrices into tensors, as follows:

A_tensor = tf.constant(A)

b_tensor = tf.constant(b)

4. Now that we have our matrices set up , we can use TensorFlow to solve this via the matrix inverse method, as follows

tA_A = tf.matmul(tf.transpose(A_tensor), A_tensor)

tA_A_inv = tf.matrix_inverse(tA_A)

product = tf.matmul(tA_A_inv, tf.transpose(A_tensor))

solution = tf.matmul(product, b_tensor)

solution_eval = sess.run(solution)

5. We now extract the coefficients from the solution, the slope and the y-intercept, as follows:

slope = solution_eval[0][0]

y_intercept = solution_eval[1][0] print('slope: ' + str(slope))

print('y'_intercept: ' + str(y_intercept)) #slope: 0.955707151739

#y_intercept: 0.174366829314 best_fit = []

for i in x_vals:

best_fit.append(slope*i+y_intercept) plt.plot(x_vals, y_vals, 'o', label='Data')

plt.plot(x_vals, best_fit, 'r-', label='Best' fit line',linewidth=3)

plt.legend(loc='upper left')

plt.show()

SUMMARY

The solution here is found exactly through matrix operations. Most TensorFlow algorithms that we will use are implemented via a training loop and take advantage of automatic backpropagation to update model variables.
How to Stay Motivated as a Developer
By: Ann Adaya
Tags: Programming, JavaScript, Work, Software Development, Software Engineering

How to Stay Motivated as a Developer

#1 Rule — Avoid burnout at all cost, it could mean chaos.

Photo by Anthony Da Cruz on Unsplash

“You’re not going to master the rest of your life in one day, relax, master the day, then keep doing it every day.”

I’m never gonna tired of saying this, programming is as hard as f***, anyone who says otherwise, bless you.

But for 99% of us developers, programming is a pain, so get over it because there is nothing we can do about it, we might as well learn to deal with it.

But working hard every single day just to keep up with the pace, isn’t sustainable at all, we just can’t work hard, we have to work smart because I don’t know if you are aware of this but being a developer isn’t a sprint in which you can give 100% of yourself every day and expect to win in the end, nope, its not a smart move at all.

This is a marathon, learn how to pace or else you’d end up not just exhausted but a quitter — don't be a quitter.

And these simple other things will literally change your life.
Sorry
By: Kevin E. Pittack Jr.
Tags: Poetry, Relationships, Haiku, Scrittura, Writing

Photo by Tima Miroshnichenko on Pexels https://www.pexels.com/@tima-miroshnichenko

I gave my best words

and poems to the one who

came before. Sorry.
Dear Poets
By: Priyanka Srivastava
Tags: Open Letter, Pandemic, Poet, Blue Insights, Writing

Photo by Robert Anasch on Unsplash

Dear Poets

An open letter for the poets

Dear Poets,

I don’t judge you when I read your poems related to anxiety because it’s been a year since I have been doing the same. In your words I can see how you are coping with the sadness. In you art I can the colours which seep through the margin. It’s okay to be vulnerable and hold on to that tiny flicker of hope.

It’s okay to show our chaos to the world.

Dear poets I hear you, it’s okay to break quietly.

Love

A reader
China Lander Reaches Moon, Will Return Samples This Month
Tags: moon, Moon, Science, Space, China

China Lander Reaches Moon, Will Return Samples This Month ExtremeTech Follow Dec 2 · 2 min read

by Ryan Whitwam

The Chinese Lunar Exploration Program is still firing on all cylinders despite the ongoing coronavirus pandemic. China’s National Space Administration has announced the Chang’e-5 lander has successfully reached the lunar surface. While there, the robot will conduct various experiments and collect a bit of the moon for return to Earth. If successful, this will be the first new sample of lunar regolith in 44 years.

There was some uncertainty as to the fate of Chang’e-5 early on Tuesday. Chinese media covered the launch on November 24th with great fanfare, but the expected landing time came and went with no announcement. Only after the Chinese National Space Administration (CNSA) confirmed the landing did Chinese state TV break in with news of the probe’s arrival on the moon.

Chang’e-5 carries an assortment of instruments like a panoramic camera, a spectrometer to determine mineral composition, and ground-penetrating radar. The sample collection module has a robotic arm, a rotary percussive drill, a scoop, and separation tubes to keep individual samples isolated. Unlike the previous Chang’e-4 mission, the latest lander does not have a radioisotope heater unit. That means it won’t survive the coming lunar night — it will have to complete its work during a single lunar day, which luckily lasts about 14 Earth days.

China hopes the mission will be able to collect as much as 2 kilograms (4.4 pounds) of lunar soil. The last sample from the moon returned to Earth came from the Soviet Luna 24 mission in 1976. It managed to send back 170.1 grams of regolith, by far the biggest haul from any of Russia’s lunar probes. Meanwhile, the US brought back hundreds of pounds of moon rocks during the Apollo program.

After collecting its lunar samples, the Chang’e-5 lander will launch an ascent vehicle that will carry them back into orbit of the moon. China might begin this phase of the mission in just a few days, but don’t expect a live play-by-play a la NASA. The ascent vehicle will rendezvous with the Chang’e-5 service module, which is still in orbit. This spacecraft is equipped with a return module to fly the samples back to Earth. China expects to have the sample containers back on Earth around the middle of December.

Now read:
Veganism Is Going Through a Racial Reckoning
By: Arabella Breck
Tags: Recommended Reading, Race, Vegan, Equality, Link

The truth is, in the United States and even globally, the majority of people who eat plant-based are nonwhite. But the white people have become gatekeepers of the vegan community, especially online with blogs and accounts run by white people dominating Google results and social media feeds.

In the weeks and months following the killing of George Floyd and global protests, the vegan community has been forced into a racial reckoning of its own with white vegans starting to acknowledge Black vegans and other vegans of color. And now, questions are being raised about how to continue to do this work moving forward.

“People didn’t see the value of our pages until now, but that drove us. And now, this is the time,” vegan blogger Afia Amoako said in an illuminating recent VICE article. “The thing that irks us is when the #AmplifyMelanatedVvoices happened our biggest question was: Are you going to support me in the long-term?”
How To Store Your AWS Lambda Secrets
By: Timothy Jones
Tags: Security, Lambda, Software Development, AWS, Scalability

How To Store Your AWS Lambda Secrets

Do it right, so you don’t have to redo it when your application load increases

Don’t tell anyone your secrets. Do tell people how to store secrets. (Photo by Kristina Flour on Unsplash)

Most Lambda deployments use environment variables to pass configuration to the deployed function. It’s the recommendation that AWS makes in the documentation, and it’s an attractive choice because it’s easy, encrypted at rest, and allows for flexibility in how you get the values there in the first place.

There are many articles with good recommendations about lambda configurations already. Why should you read this one?

Instead of comparing and contrasting approaches, this is a how-to guide for anyone whose primary values are minimising cost without compromising scalability or security. If you have additional or different needs, I recommend reading the links above as well.

This guide is aimed at small to medium teams working in contexts where security matters, but fine-grained permission management might not.

Just tell me the answer

If you’re here from Google and just want a recommendation, feel free to skip to the end for the summary. If you want the detailed rationale behind the recommendation, read on.
This Thanksgiving, We’re Eating A Pelican
By: Laura Shepard
Tags: Humor, Satire, Lifestyle, Food, Writing

This Thanksgiving, We’re Eating A Pelican

The best alternative to turkey.

Photo by Wayne de Klerk

2020 has been one for the books, and I don’t mean the history books. I mean the recipe books. That’s right. Forget everything else, because this Thanksgiving, we’re not eating turkey. This Thanksgiving, we’re eating glorious pelican fresh out of the sky.

I know what you’re thinking: What the fuck are you talking about? But before you cram your AirPods back in and keep doomscrolling into the future, hoping that whatever vaccine comes out will also make you more attractive, let me let you in on a little secret: Turkeys are fucking lame. They’ve got a dick for a neck, an umbrella for an ass, and a bad attitude. They’re doused with Tryptophan that will make you fall asleep faster than you can say “Make America Suck Again” and have assholes full of gizzard farts. Some say the Tryptophan bit is a myth, but do you know what’s really a myth? Plymouth Fucking Rock. Stop believing turkey propaganda and get you a bird that can fly.

The pelican’s beak is a battleship. Its wingspan the Sydney Opera House; its feathers dictionary pages. It swallows fish the way the whale swallowed Jonah: whole. This is what you need. You need a bird that hunts by plunging into the ocean like a forty-miles-an-hour turd knowing that if it dies well then at least it truly lived.

Let me tell you something else. There’s a little something in each turkey and it’s not stuffing. It’s a desire to bring you down, to the low vibrations of the Earth, to the place where birds can’t fly. What is your tie to the turkey anyway? You didn’t invent it. You didn’t say, “Hey, look at this bird I invented.” Is it because you wanted to be the turkey in your first-grade Thanksgiving play but Mrs. McNally assigned you as the Mayflower? With no speaking part? Is it because when you were waiting backstage before the performance, proud pilgrim Suzanne Baker looked at you in your cardboard boat trash as if she just knew you were going to fuck everything up? Is it because Ricky Wilson got to be the turkey and he also won the best handwriting award that year when you know damn well that his handwriting sucked and now Ricky is a successful sports commentator? Well get over it and clear a spot on your plate for a bird with eyes like halos. 2020 is the year of the pelican.

When the pelican takes to the wind it spreads its wings the same way socialism spreads: like magic. Each feather lifts in an aerodynamic orgasm to match the curvature of Communion bread as the bird ascends further into the celestial sphere, only looking below to judge lesser beings, flapping its wings to the rhythm of Pomp and Circumstance. Unlike the turkey, the pelican has no regrets.

And so I invite you to imagine this: your Thanksgiving table overflowing with festive china, rolled napkins, and trays of casseroles, mashed potatoes, gravy, cranberry sauce, Aunt Judy’s creamed heart-attack pasta, all centered around a grand, flaming pelican.

Now that’s what I call history.
How the “Playing Alone Together” Phenomenon Keeps You Writing on Medium
By: Victoria Ichizli-Bartels
Tags: Gaming, Community, Writing Life, Psychology, Ideas

I didn’t know that there was a psychological term for those experiences then. But I will always treasure and tap into the power of doing something “alone together.” We often do it in my family. My husband and children sit at our kitchen counter, each with a computer or a laptop, and play their games. Sometimes together, but also separately their own games, pausing occasionally and talking about what they just did or are about to do.

You probably experienced this in your life many times as well. But you might not have been aware that this very phenomenon might be one of the forces helping you to keep on writing on Medium.

To illustrate how and why, I will quote one for the World of Warcraft players as Jane McGonigal did it in her book Reality is Broken:

“I love being around other real players in the game. I enjoy seeing what they’re doing, what they’ve achieved, fighting with them, fighting against them …, and running across them out in the world ‘doing their thing’ while I’m doing mine. Chuck a heal there, apply a buff here, kill that thing that’s about to kill that player, ask for some quick help or information, gank someone of the opposing faction, scurry and hide before they can gank me, join up for a spontaneous quick group, etc. Thanks, it’s been real and I’m on my way.” — “That’s Right, I Solo In Your MMOs!” (June 09, 2009), Mystic Worlds

You might not be killing any creatures here on Medium, but the process will sound very familiar to you.

You do your thing, and you can enjoy seeing other writers doing theirs. You come across them in the pieces they authored or their responses to your stories. You can ask them “for some quick help or information.” And you can even fight against them by disagreeing with what they wrote, or you can fight along with them by supporting their point of view.

And you can join others in a spontaneous group by, for example, highlighting the same bits as they did. You signal to them and the author that those bits resonate with you, and you join in experiencing the thought those pearls of wisdom conveyed.
How to have very clear ideas: an introduction.
By: Charles Davies
Tags: Work, Very Clear Ideas, Entrepreneurship, Ideas

Over the last ten years, I developed a process that can turn a not-very-clear idea into a very clear idea in about two hours. I’ve used it more times than I can count, helping hundreds of entrepreneurs and artists and whoever get clear on what they’re doing. It’s different every time, but this is roughly how it goes.

This is how it begins.

Someone says, ‘There’s something I’m not very clear about that I’d like to be very clear about.

And you say, “OK. What are we talking about?”

And they say, “I want to be clear about my career. Or my new project. Or my life. Or the book I’m writing.”

And you spend a little time working out what it really is that they want to get clear about.

And then you help them get clear.
Putting a Face on Coronavirus Introduction
By: Brenda Mahler
Tags: Faces Of Covid, Poetry, Introduction, Coronavirus, Covid 19

Putting a Face on Coronavirus Introduction

This virus is not anonymous: it bears all our names

Photo by Tim Mossholder on Unsplash

I am a social creature exploring my environment from in front of my computer screen. As I scroll through social media, I encounter all the hues of emotions: denial, anger, depression, resolution, contentment . . . Each person who shares how COVID has changed their life has a story to tell.

With a desire to illuminate people, I developed an activity to connect faces to this insidious disease. People where asked to participate in a project. Everyone who participated was asked the same questions and their responses developed into poems sharing their experiences.

What is your age and sex? State two things you love to do? What do you celebrate? Life is _____________ What object represents COVID? (Think of a symbol) Why is it like COVID Two words that describe the object What does COVID smell like? If COVID was an animal which one would it be? How does the animal move? What sound would this animal make? What is your favorite food? What is your most disliked food? What do you want to shout from the mountain tops? Make one statement about the pandemic.

Below are the first two poems of this project
Illustrated: 10 CNN Architectures
By: Raimi Karim
Tags: Machine Learning, Towards Data Science, Convolutional Network, Deep Learning, Visualization

Illustrated: 10 CNN Architectures

A compiled visualisation of the common convolutional neural networks

(TL;DR — jump to the illustrations here)

Changelog:

28 Nov 2020 — Updated “What’s novel” for every CNN.

17 Nov 2020 — Edited no. of layers in last dense layer of Inceptionv1 from 4096 to 1000.

24 Sep 2020 — Edited “What’s novel” section for ResNeXt-50.

How have you been keeping up with the different convolutional neural networks (CNNs)? In recent years, we have witnessed the birth of numerous CNNs. These networks have gotten so deep that it has become extremely difficult to visualise the entire model. We stop keeping track of them and treat them as blackbox models.

Fine, maybe you don’t. But if you’re guilty too then hey, you’ve come to the right place! This article is a visualisation of 10 common CNN architectures, hand-picked by yours truly. These illustrations provide a more compact view of the entire model, without having to scroll down a couple of times just to see the softmax layer. Apart from these images, I’ve also sprinkled some notes on how they ‘evolved’ over time — from 5 to 50 convolutional layers, from plain convolutional layers to modules, from 2–3 towers to 32 towers, from 7⨉7 to 5⨉5— but more on these later.
Rage
By: Holly Jahangiri
Tags: Poem, Emotions, Poetry, Writing

Poetry

Rage

The sweetness belies a hard, bitter, toxic core.

Photo by Alexander Mils on Unsplash

My heart is a ripe peach. Soft flesh, life’s blood

Flayed open to the bitter almond core -

A poisoned kernel you carelessly mistook

For a nut. Bite deep, and taste the juices.

In silence, as war, we call no truces.

Memory turns crumbling pages of the book

You call a mind, illustrated no more.

Just letters, words, and colors in a flood.

Touch me, and I will set my hair on fire

While you scream, to prove I still burn for you.