Friday, December 31, 2021

New Year

 source: Passeport SantΓ©, August 2019

author: Agnes Bourahla

translation: GoogleTranslate/doxa-louise

Overthinking

" Overthinking ": literally, to think too much. An American researcher in psychology, Susan Nolen-Hoeksema has described this illness extensively, and the means of remedying it: she relates them in her work entitled  Women who think too much...How to break free of overthinking and regain your life?  Because, in fact, overthinking tends to mainly affect women. Susan Nolen-Hoeksema defines, in fact, overthinking as being " the propensity to rehash in a loop, in an obsessive way, a certain number of negative thoughts or feelings ". Here are a few tips to avoid falling into its chains ... Or manage an escape!

 Overthinking: a torrent of negative thoughts and emotions

" Many of us are sometimes overwhelmed with anxieties, thoughts or feelings which, getting out of our control, drain our emotions and our energy ." Thus, in these terms the psychologist Susan Nolen-Hoeksema describes a fit of overthinking: " torrents of preoccupations and negative emotions which undermine our daily life and our well-being ".


People prone to such ruminations then start tracking down every clue, thinking for hours… Result? The anguish only increases. Thoughts flow according to  mood, without  being able to find the answers.


Women are more prone to these forms of excessive ruminating than men. And they can do it on anything and everything, from their looks or their excess weight, to their family, their career or their health. " Escaping overthinking, believes Susan Nolen-Hoeksema, is like trying to free yourself from quicksand. To regain freedom, the first step is to loosen the grip of the thoughts that are suffocating you ."

 Brain: why do some people fall more easily into overthinking?

Several research studies on the brain explain that some  of us are more prone to rumination than others. This is how the American psychologist Richard Davidson deciphered, via what he calls "affective neuroscience", the multiple ways for the brain to process emotions. A medical imaging technology has thus made it possible to demonstrate " that negative emotions activate the right side of a part of the brain, called the prefrontal cortex, more than the left side ". The prefrontal cortex is the region of the brain allowing the regulation of emotions, that is to say the capacities to filter and control them.

A dysfunction of the prefrontal cortex would thus be at the origin of poor regulation of emotions, which can result in overthinking, or even a tendency to depression. In addition, two other parts of the brain could also be involved: the amygdala and the hippocampus, which are the sites of learning and memory of emotional situations. They sometimes turn out to be deteriorated in people prone to depression and rumination. And so, an overactive amygdala could for example lead to being "too sensitive", to too easily pick up all kinds of negative information.

 Escape from its nets: freed, rescued 

Susan Nolen-Hoeksema writes: " Breaking free from overthinking is not easy. It requires regaining self-confidence, letting go of uncontrollable negative thoughts ." A first step that is essential ... There are several solutions for this. Numerous studies carried out on depression, in particular, led by the American psychologist Peter Lewinsohn among others, have shown that "in order to be cured, it is essential to break the vicious circle of overthinking and passivity ". 

Several escape routes allow you to free yourself from it: among them, that of taking a break. Give yourself a distraction. " Through a study, I found that it only takes an eight-minute moment of distraction to regain your good mood and break the circle of obsessive thoughts ," says Susan Nolen-Hoeksema. The means are diverse, from the practice of a physical activity, in particular those which require complete attention such as badminton or climbing, to manual activities, or even by investing in volunteering.

Some people take refuge in unhealthy activities, such as bulimia or alcohol abuse. It's a decoy: " If eating instantly gives an impression of relief, the boomerang effect is almost instantaneous. We blame ourselves for having given in to packets of cakes, we are depressed by our lack of willpower. The same goes for alcohol, ”writes Susan Nolen-Hoeksema. Who ultimately advises to hunt down happiness and live it. 

 Toward a new beginning

The moments of pleasure, the search for happiness, make it easier to overcome various sorrows, or bereavements. The ability to be happy also affects the quality of thinking. Positive emotions decrease the negative effects of chronic stress on our physiological system. A fascinating survey conducted by psychologists in Kentucky tends to show that moments of positive emotions even prolong the duration of life: these researchers have indeed shown, in nuns, that those who had known how to live positive emotions had lived on average ten years older!

The practice of meditation is common: nearly 40% of people interviewed by Susan Nolen-Hoeksema say they turn to prayer or meditation in order to break their confusion and overthinking. " Although our era has lost a certain sense of Christian values, many believe in a higher entity, in a supreme guide ," suggests the American psychologist.

Concentrative meditation, which consists of focusing intensely on the present moment, on a sentence or an image, as well as clairvoyant meditation, which advocates becoming intimately aware of each thought, image, idea, physical sensation as soon as they arrive , can both be a good way of unloading one's burden… We will also mention writing, or the fact of indulging in small daily pleasures, such as watching a comic film, walking around a pleasant site, or playing with small children ...

In addition, the help of a therapist or that of a judiciously chosen marriage counselor may, when necessary, make it possible to remedy a situation conducive to overthinking, such as, for example, conflicts in within the couple.

What if, finally, following the philosopher Maurice Bellet, we now simply had to " invent a new way of being in the world "? Capable, in all humility, " to be a new beginning "? Carpe Diem ! Let's enjoy the present moment .

                                                              *     *     *

Is this the wrong piece to upload for today? The situation is serious; I am such a frivolous person. This will never do. It is focused on women, and for a holiday and all that. πŸ™‡‍♀️


HAPPY 2022!!

Monday, December 27, 2021

NN Assignmemt

 The assignment for CS50 AI neural Networks involves using Keras to

work with gtsrb. Effectively, one is writing code for a neural network

for traffic sign recognition.


Keras is a python front-end for Google's tensor flow. It is a library we can

call upon to specify a dataset and how we wish to train on it. 






Our code uses relu activation, which is the simplest:



Running the completed assignment:

                                        


https://github.com/dtemir/harvard-CS50AI/blob/master/traffic/traffic.py

A_R

 Alexandra Rodriguez shared a difficult Christmas night with her

diabetic1 mom:the lady's blood sugar just wouldn't go back up.

Might just be a problem with the math.


D1 people normally take two kinds of insulin for the day: slow-acting and

immediate acting. On a special occasion such as a Christmas party, the person

will adjust her doses upwards, to counterbalance party food. Perhaps she

never got around to eating as much as she had anticipated, or for what her

adjusted dosage would allow.


That injected insulin will stay on the job, regardless of circumstance. I would

audit the whole situation...Hope this helps 😐



Friday, December 24, 2021

XMAS21




*     *     *

Ended up making a quite nice supper; a TexMex dish I
had never attempted before: stuffed peppers. I had the good
sense to use both techniques to promote the cooking of the
pepper envelope. I boiled them for a few minutes before stuffing,
and I cut them open lengthwise.

The filling was pilaf rice, canned turkey, strained  tomatoes, oregano 
and cayenne pepper, topped with various cheeses. 45 minutes under
foil in a 350° F oven. Nice!


 

Wednesday, December 22, 2021

Getting_Silly

 It does appear the the Omicron variant is different enough that it 

has the capacity to infest the previously infected and the vaccinated.

So although it spawns less serious cases for most of us, from the

point of view of slowing the spread, one should see oneself as vulnerable

and stay away from crowds as much as possible. Got it.


My pharmacy was really clever about the test kit: they called me last night

one hour before closing time and told me I had an hour to pick it up. I did, in

a largey empty pharmacy.


The piece below contais some interesting information: Omicron is different enough

that it may have emerged from someone with a compromized immune system, giving

it time to accumulate mutiple mutations without interference!?


I am not looking forward to queuing outside for stuff. Quebec in winter is no joke.

Waiting outside 4 or 5 hours for a test may no longer be humane as the temperature 

plummets in the next few days. And crowding in shopping centers outside a reduced

entry store is silly and counterproductive.


https://www.theguardian.com/commentisfree/2021/dec/22/omicron-scientists-variant-virus-lab-public-health

Tuesday, December 21, 2021

Water Weight

 Oh, just tell us!... Premier Legault to make further announcements on 'their decisions'!?

Found this intriguing item in the Montreal Gazette coverage for Wave 5:

                                                             *     *     *

On the up side, finally got it straight on what water weight is. Now feel free to retire

jokes about it from my repertoire.

Monday, December 20, 2021

The C

 On it goes, wave 5 of the pandemic!!


                                       *     *     *

Trying for this year's windswept look for a Christmas tree. Not sure

I'm hitting it...


Tomorrow is the first day of winter πŸ™‚

Sunday, December 19, 2021

Self-driving

 In computer vision problems, two techniques are widely employed:



This most famous matrix - because it adds up to zero - cab be used to produce a black

and white image.


Pooling can be used for the compter to identify features of an image.





this is how a self-driving car might 'see'.





Saturday, December 18, 2021

Hidden Layer

 The value of neural networks - and tensorflow, as a library - becomes

evident if we rerun the banknotes project, we worked up as a simple

case of supevised learning. On 500 banknotes, the computer caught the 

true ones, but might miss 5 straggler false bills. Not anymore.


Looking at the data as a neural network problem:

One has to install tensorflow with pip.


Code for a neural network:




Running for 20 iterations:


Running for 30:


There is an 8-unit invisible layer...

Thursday, December 16, 2021

GDescent

 The site is : playground.tensorflow.org


One can play with the parameters to a neural network problem and run

the algorithm. At this point, just using the two splotches of dots from the left

as a sample program.


Starting with random weights to a linear equation, one builds up knowledge 

through iteration. Gradient descent (Cauchy) identify the direction in which

the weight measurements should move.
















So one begins with a perceptron - whih only does linear relationsships, as seen in

Supervised Learning - and one propagtes error backward for a better fit.

There are refinements to consider, testing in smaller subsets to avoid being misled

by non-generalizable data. One also adjusts for overfitting by running partial

versions of the model.Ultimately, one works with a library for 'robust' results.


                                                            *     *     *


Training data for recognizing handwritten numers...



Wednesday, December 15, 2021

Monday, December 13, 2021

C_Update


Chilling Covid Stats from CNN:


 

Ices

 Le Journal de Montreal, this morning, has a useful overview

of ice thickness. and what to look for before undertaking sports

on ice:



Bien Γ©valuer l’Γ©paisseur de la glace | JDM (journaldemontreal.com)


                                                                   *    *    *

Today is a beautiful day, sunny and warmish AND it is a Monday. What this means

where I live is that it is Seniors'day at the Malls and stores, where we older folks are 

encouraged to shop, given smiles and little discounts.😊


That said, I did peek at the next CS50 AI lecture (Neural Networks) and it's pretty steep. 

Involves something called 'back propagation'  but then it makes thing like image

recognition possible. Γ€ venir...


Saturday, December 11, 2021

Unsupervised

 Having seen Supervised Learning and Reinforcement Learning in AI, we are left with

a third category of Unsupervised Learning. In this case, one does not have pre-defined

categories to exmine the data, but rather want to look at data and search for patterns within.


One can appreciate, visually, what this means below. Out of a maze of colored points,

one is trying for logical assignments. This will be done by grouping by least distance 

from an assigned center; and subsequent taking the measure again to shift the center

until all runs give the same out put. 






A bit like doing Christmas make-up πŸ˜„



Friday, December 10, 2021

WSequence

 this is how the US Westher Service sees the upcoming weather

sequence:




Thursday, December 9, 2021

NIM the Game

 Got a working version of the nim play code. Sure enough, and just

like in the lecture, the computer wins after all that training. Who goes first

is set randomly so I played the computer against itself. Player 2 won!?




https://github.com/nahueespinosa/ai50/blob/master/nim/nim.py

BingeCringe

 I've been touched by the mental struggles of binge eating young women

on YouTuve lately. From the vantage point of my advanced age and experience -

ahem - I might add this. The struggle is real, ladies, but there is a pysiological basis

to the whole thing. Dr Mike spilled it; eating sugar, or any quick-release carb, will

augment the production of ghrelin, the hunger hormone. One just feels more, and

more, hungry the more one lapses into a sugar episode. That's the dark secret.

There is nor cursed mental state that afflicts binge eaters. They are quite normal

people...on a binge.


Three meals a day, no snacks, and correct for excessive hunger by eating more 

high-fiber veg, fruit and protein at the expense of carbs for a while. All will snap back 

into place in a day or two. 


You are not helpless with respect to food. Everyone should have some go-to breakfast

to kick-off a new more subdued cycle. An egg on toast with a cup of tea!? You get 

the idea. All meals should have pre-defined boundaries: a cheese sandwich contains

no more than one ounce of cheese, a serving of rice and chicken is only so big, and

so fort. Planning, and sticking to plan, is the key. And no all or nothing thinking.


https://www.youtube.com/c/DoctorMike

Wednesday, December 8, 2021

MyBDay

 Having a birthday today. It's miserably cold out! Should I stay in

and shop all day??




Tuesday, December 7, 2021

NIM

 In the classical supervised learning model, one chooses between

possible scenarios that are external to the subject: ie rainy day vs non-rainy

day. In reinforcement learning, the agent has to make  choices, going

from one state to the other. It then becomes a matter of keeping

track of outcomes for each and every state and action consequence.

The markov chain becomes a Markov Decision process.





Our goal, then, is to generate a function Q:



It seems appropriate to then implememt greedy decision-making ie always

move to maximize our outcome reward. But that might get stuck in not exploring

sufficiently to make an optimal decision. One thus needs to reintroduce an element

of randomness so that the robot/agent occasionally moves randomly.




The example that comes in the lecture is a learning program for the game of NIM.

It is illustrated but the assignment is to complete some of the NIM functions...


(Cute game: eaxh player removes as many dots as desired on a row at each move.

whover removes the last dot looses)

The computer is going to train playing 10,000 games against itself, with alpha

at 0.5 (the factor for updating the value of a move from new information), and epsilon 

at .10 (how often a random move will be tried). Computer should be a formidable

opponent after this practice...


In the case of NIM, it's pretty cut and dried that thecomputer needs to keep track

of everything. In a larger game-space, one might use approximations that recognize patterns.





Monday, December 6, 2021

Switch

 After years of castigating the health establishment for promoting

low-fat (and thus high-sugar) food planning, the health and fitness 

people seem to have come to a new understanding. It is insulin spikes that distort

metabolism, stop weight loss, and promote hunger attacks. Once insulin production

is under control, eating reasonably is not that difficult. And weight stability sets in.


Hoorah! am happy there is a consensus. Where there does seem to be debate, though,

is between low-carb and all-out keto. 


To my mind, this is not a trivial debate at all. As an older person, I really appreciate

 not having to diet any more. If one morning I am 200 grams heavier, I have Ryevita

crackers with peanut butter and tomato, rather than with peanut butter and banana.

And that is as serious as it gets. But the proponents of all-out keto make a stonger case. 

I might be endangering my health by keeping bad carbs in my diet. Sugar is a poison.


I did google whether ketosis or glucose metabolism came first in human evolution. What 

I did find out is that it is Neanderthals who introduced starchy vegetables to the human diet.

Perhaps to feed a larger brain; or provide more stamina. A puzzling but interesting

question...





Sunday, December 5, 2021

Sunday Hungry

 I'll have the pumpkin pancakes; what about you!?

Some menus are just over the top. These people even have t-shirts!!


Order for Takeout or Delivery | Electric DIner (electricdinerhamilton.com)

Thursday, December 2, 2021

Nearest

 Been playing with the firt assignment on the Learning lecture, CS50 AI.

Found someone who had successfully completed the empty functions and ran

the code. There is a huge - 12,000 records - of visits to a shopping site as data

for the assignment. One opens it in Excel or some such, to peruse the data.

Below, I am on the free Google spreadsheet.






The code uses the Nearest-Neighbor algorithm to predict whether a shopper will

make a purchase or not. The last column in the data records whether a purchase was 

made last time.


All in all, good at predicting a purchase will not be made, but less so about when one

will.


Need to read up more on what is going on. Why I am getting slightly different results

with every run!?

                                                                 *     *     *

Why Do I Get Different Results Each Time in Machine Learning? (machinelearningmastery.com)

What Does Stochastic Mean in Machine Learning? (machinelearningmastery.com)