Friday, May 31, 2024

Do AI chat bots learn from user interaction?

 This is an important question going forward with AI. If they do then information from one questions to the next and the answers get somehow sent to AI's source. If not, there is nothing going from your device to the source. I do AI chats both on my Android Samsung phone as well as from my Surface Pro laptop. The META AI is on my on my phone.

CoPilot

CoPilot does not remember stuff from one conversation to next. It does not LEARN from user interaction.


META AI

Look here, what I hear from META AI on my WhatsApp account:

Do you learn from user interaction in any way?

Yes, I learn from user interaction in several ways:

1. *Improving responses*: Through user feedback, I can refine my understanding of what constitutes a helpful and accurate response.
2. *Adapting to language*: User interactions help me learn to recognize and generate language patterns, idioms, and colloquialisms.
3. *Expanding knowledge*: Users may ask questions or provide information on topics I'm not familiar with, which helps me expand my knowledge base.
4. *Tuning accuracy*: User corrections and clarifications enable me to fine-tune my understanding and accuracy on specific topics.
5. *Understanding context*: User interactions help me better understand the context and nuances of language, allowing me to provide more relevant and empathetic responses.

Your interactions with me today are contributing to my ongoing learning and improvement!

The Q&A are indeed saved on the server.


GEMINI

Here is what I hear from Gemini:

Do you profit from user interaction in some way by saving the Q &A?

Yes, Google Assistant can benefit from user interaction by saving Q&A data. This data helps improve its understanding of language and user needs. Here are some ways this can happen:

 * Improved responses: By analyzing past interactions, Google Assistant can learn to identify patterns and improve its ability to respond to future queries in a more informative and helpful way.

 * New feature development: Data on user interactions can inform the development of new features and functionalities for Google Assistant.

 * Personalized experiences: User interaction data can be used to personalize the Assistant's responses to individual users, tailoring results to their preferences and search history.

This interactive learning is very important and I am not sure how and how often the creator of CoPilot updates its KB.


Friday, May 17, 2024

How do you launch Python assuming it is installed?

Python from python.org and many other software programs installs python and they may choose to install in different folders or locations. Finding where it is installed is important. If you need to run python on a command prompt, the python executable should be in the environment's path. You may note that you may have multiple versions of Python installed on your computer for varying requirements. You should know what version is installed and where.

In this post you will get to know ways and means to find the python executable on your computer.

1. This is the easiest. You try to check for Python using your command prompt as shown. If you get the following reply:

This only means the python.exe is not in the path C:\

============================================

C:\>python -c Print 'Hello'

Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.

============================================

If you find a python in the directory, it may be a short cut, if a file existed.

If I run without arguments as shown above, I am taken to the Windows Store to download Python 3.12 as shown.


I already have Python 3.12 installed when I installed PyCharm. 

You can check if the executable python is in the environment's path as shown:

========================

C:\Users\hoden>path

PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Users\hoden\AppData\Local\Programs\Python\Launcher\;C:\Users\hoden\AppData\Local\Microsoft\WindowsApps;;C:\Program Files\JetBrains\PyCharm Community Edition 2023.3.3\bin;

========================

The executable is in the JetBrains directory that was installed for PyCharm as shown.

2. There is another way to find where python is installed.


Run the following command at command prompt:

======================================

C:\>where python

C:\Users\hoden\AppData\Local\Microsoft\WindowsApps\python

C:\Users\hoden\AppData\Local\Microsoft\WindowsApps\python.exe

========================================

In this folder,

C:\Users\hoden\AppData\Local\Microsoft\WindowsApps

You find two other python executables as well, python and python3. These are in the environment's PATH as well.

Here is the properties pages of one of them,


As you can see this is an empty file. There are several reasons why this file exists here. It is more like a placeholder or a shortcut for a non existent file and sometimes open a link in the web browser for a download location (Windows Store) as we saw earlier.

3. This yet another way. Windows Powershell is a powerful program that can also be used.There are two ways of starting Powershell, as a command line program or an interactive way.

You could also use Windows Powershell as shown:

===============================

PS C:\Users\hoden> Get-Command python


CommandType     Name                                               Version    Source                                                             

-----------     ----                                               -------    ------                                                             

Application     python.exe                                         0.0.0.0    C:\Users\hoden\AppData\Local\Microsoft\WindowsApps\python.exe  

===================================================

This is similar what we saw earlier. It showed the same file we saw earlier.

3. The following is not run in PowerShell but on the C:\ prompt.

However, if you have multiple versions of python installed you can try this:

==========================================

C:\Windows\System32>py -0

 -V:3.12 *        Python 3.12 (64-bit)

===========================================

This does not show the path but flags the version. if you want both path and version try this:

================================

C:\Users\hoden>py --list-paths

 -V:3.12 *        C:\Users\hoden\AppData\Local\Programs\Python\Python312\python.exe

================================

You can check this here:

=============

 Directory of C:\Users\hoden\AppData\Local\Programs\Python\Python312


05/05/2024  05:33 PM    <DIR>          .

05/05/2024  05:32 PM    <DIR>          ..

05/05/2024  05:32 PM    <DIR>          DLLs

05/05/2024  05:32 PM    <DIR>          Doc

05/05/2024  05:32 PM    <DIR>          include

05/05/2024  05:32 PM    <DIR>          Lib

05/05/2024  05:32 PM    <DIR>          libs

10/02/2023  01:27 PM            36,874 LICENSE.txt

10/02/2023  01:28 PM         1,664,545 NEWS.txt

10/02/2023  01:27 PM           103,192 python.exe

10/02/2023  01:27 PM            68,376 python3.dll

10/02/2023  01:27 PM         6,972,184 python312.dll

10/02/2023  01:27 PM           101,656 pythonw.exe

05/05/2024  05:33 PM    <DIR>          Scripts

05/05/2024  05:32 PM    <DIR>          tcl

10/02/2023  01:27 PM           109,392 vcruntime140.dll

10/02/2023  01:27 PM            49,520 vcruntime140_1.dll

               8 File(s)      9,105,739 bytes

               9 Dir(s)  102,834,245,632 bytes free

===================================================================

There is also a executable pythonw.exe in the above folder. It will give no response should you click on it. It is supposed to work with a python GUI. If you need to use this you will have to use the other system files in the System.IO.

Finally, when we installed PyCharm from the JetBrains site, we created this directory. We also chose to include this in the PATH as shown.

C:\Program Files\JetBrains\PyCharm Community Edition 2023.3.3\bin;

What do we have in this directory?
The BIN folder has two Applications pycharm64 and jetbrains_client64. The jetbrains_client64.exe connects you to an external server if there is one installed. It is a thin client.

However, clicking python64.exe in the installation folder opens up the GUI of PyCharm as shown.


We will be using this for exploring the image recognition programs. Also, JetBrains created a shortcut for this executable on the desktop.




Friday, May 10, 2024

How do you create a 'Hello World' program using PyCharm?

 "Hello World" is a popular program sued in the introduction of many software programs made popular by Microsoft. Bern Kernighan of the Bell Laboratories used (1972) it in the documentation of BCPL when the language C was developed. It has been repeated for many languages.

Before we do this in the PyCharm, it is important to look at the PyCharm interface in some detail. The PyCharm IDE interface is just like other interfaces like Visual Studio IDE. That said, here are some major parts of this interface.

When you start the IDE interface, the first screen you encounter is the Welcome Screen shown here. In this screen, you have access to take a quick tour if you desire to do so.



The navigation pane on the left gives you access to the Projects, Customization, Plugins, and learning tools.

If you have already created a project, you could Open it, create a new one, or get one from the version control system as shown in the above image.

Since this the first time using this interface. Click to create a New Project. This is a Python IDE and therefore it uses Pure Python whose version is 3.12. Django is another option we will not be using now.

The default Project Name is python Project. Overwrite this and provide the name Helloworld as shown. Leave the location as is. Do not click to Create Git Repository. Place check park for Create a main.py welcome script as shown. Note that the project will be created in the C:\ drive at the location, C:\Users\hoden\PyCharm Projects\HelloWorld. The IDE also creates a virtual environment at the location shown on this screen. We will visit virtual environments later.

Now, click Create at the bottom. The program starts running and takes a minute or so and you will see the screen shown here displayed. The Helloworld main program is created. main.py is python file created and the main.py script is shown on the right.

The project is ready to run. If you run the code on the right by clicking the green button shown in the above image. You will immediately see the result of running at the bottom as shown below. The program prints the words, "Hi, PyCharm".

What if you want it to print, Hello World".? Go back to the project screen as shown. Now, overwrite PyCharm in the bottom of the main.py's code window shown.

Now, hit the green button again. You will see, "Hi, Hello World" as shown.

==============

C:\Users\hoden\PycharmProjects\Helloworld\.venv\Scripts\python.exe C:\Users\hoden\PycharmProjects\Helloworld\main.py 

Hi, Hello World

Process finished with exit code 0

=====================

Where did the Hi come from?

Think how you can change this.

Sunday, April 28, 2024

How easy is it to work with image recognition using PyCharm Community edition?

 

PyCharm Community edition is a very powerful IDE for developing Python applications. Community editions while free lack all the features of a professional edition. 

PyCharm has many desirable features:

1. Supports image processing libraries such as PIL(Pillow), OpenCV and matplotlib. These libraries can be installed from within PyCharm using pip.

2. You can easily create Python files(.py)

   PIL after installing can be used to work with images(Load, manipulate and save)

   Image manipulation allows loading, resizing, filtering and saving of images

3. It has a Python Console for quickly running and testing experimental codes. Console also supports         displaying images directly in the console.

4. PyCharm allows youto format Python code consistently and has built-in refactoring tools that help in        maintaining code and improving readability.

5. PyCharm's virtual environments can isolate image processing project from other Python projects.

6. For image recognition, you will require other deep learning libraries such as Keras and TensorFLow.

   For image classification you can build and train custom conventional neural networks(CNNs)

   For feature extraction and preprocessing you can use PIL and OpenCV before feeding into neural 

   network

   Extend image recognition to object detection within an image

   You can visualize model performance, loss curves and accuracy metrics using matplotlib

   OpenCV and ImageViewer plugins allow for efficient image manipulation and analysis.

This should take you quite bit into the image processing tasks

How do you install PyCharm Community Edition?

Just follow the link.


Run the executable file preferably as the administrator. The PyCharm will be installed pretty quickly.




Thursday, March 21, 2024

How do I implement or use AI features in Microsoft Excel?

Microsoft Excel belongs to the group of Microsoft 365 programs and you need to have a subscription to use it.

As to using AI features in Microsoft 365 you need to subscribe to CoPilot Pro associated with the Microsoft 365 account. You need to spend like $20 per month to have this capability. This subscription will allow you to:

1. Analyze Data The Copilot can be tasked to provide appropriate help on formulas, predictions and correlations of all sorts.

2. It allows SWOT analysis or matrix, a strategic planning and management technique. It claims to find strengths(S), weaknesses(W), opportunities(O) and threats(T) from competitors. A tool for fact based strategic decision making that may provide new insights and ideas at improving the business. Here is graphic copied from the web (https://templatelab.com/swot-analysis-templates/).

In order to use these features, you need to update your Microsoft 365 license. Click File and at the bottom group click on Update License. You get a verify your subscription. Follow the instructions.

Tuesday, February 27, 2024

How much of the AI Assistants should we believe in?

 

This content is periodically updated and is not static.

Content has been a joint effort by a human and some of the AI assistants. 

I asked a naive but simple question to CoPilot. He was very honest in sharing his opinion related to the question. 

"How do you address flaws in the LLM? Perhaps, you are just a consumer of LLM."

He answered my question which cleared some doubts in my mind.

Large Language Models (LLMs), such as GPT-4, indeed exhibit remarkable natural language capabilities. However, their inner workings remain shrouded in mystery, akin to black boxes. Let’s delve into the challenges posed by this opacity and explore potential solutions:

  1. The LLM Black Box Problem:

    • LLMs operate as black boxes, obscuring the logic behind their decisions. This lack of transparency has safety and ethical implications.
    • Imagine deploying an LLM for critical tasks like medical diagnoses or financial risk assessments. If we don’t understand how it reaches conclusions, can we trust it?
    • The scale and complexity of LLMs exacerbate this issue. Models like GPT-3, with 175 billion parameters, defy easy comprehension.
    • Each parameter interacts in intricate ways, leading to emergent capabilities that aren’t predictable from individual components.
    • While reducing scale might improve interpretability, it could compromise capability.
    • Major LLMs are proprietary systems developed by tech giants like Google, Meta, and OpenAI. Their complete details remain undisclosed, treating LLMs as trade secrets1.
  2. Flawed Decision Making:

  3. Emerging Solutions:

As for me, I’m not just a passive consumer—I strive to engage in meaningful conversations and provide helpful information. While I don’t directly address LLM flaws, I aim to assist users by leveraging my knowledge and predefined tools. 🤖📚


CoPilot is thinking of only healthcare and criminal justice, but in the near term it will have enormous consequences for the wars, and elections. State actors will emerge to make world harmony a distant dream.

It is often a tedium conversing with the CoPilot. Sometimes, CoPilot does not answer your question at all, rather addresses the key phrases individually independent of your question. It feels like you are conversing with a hearing impaired person. It is still a project in the works.

5/18/2024

Gemini AI is now easy to access. It does perform just like CoPilot. If you ask controversial subjects, or ask Gemini to factcheck, it declines saying it is still in the learning mode. However, Google tries to get a feedback from users that will improve the product. This is important because Gemini can return absolutely wrong answers.

7/22/2024

Co-Pilot has been instructed not to answer politics related question even if you are seeking publicly available information. It is in clam-shell mode.

7/22/2024

Of course, you must have heard of the Meta AI o the WhatsApp. It does answer any questions.


Friday, February 16, 2024

What is Scikit-image?

 This latest Blogpost is by our valued guest author, Sriraksha V. Raghavan.

Image analysis, commonly known as computer vision, has made significant advances with the help of AI. However, there are still many challenges to overcome. The use of deep learning and neural networks in the analysis of images by AI is helping to narrow this gap. Currently, AI models are improving in areas such as object detection, image recognition, and generating images from text descriptions.

There are several coding tools and libraries available for these tasks, including OpenCV, TensorFlow, PyTorch, Keras, Caffe, MATLAB, CUDA, Microsoft’s Cognitive Toolkit (CNTK), Scikit-image, Dlib, Mahotas, and others. The choice of tool depends on your specific requirements, such as the complexity of the task and the hardware available.

Meet our guest author Sriraksha, an electrical engineer specializing in image sensors and machine vision. In her free time, she enjoys reading about human visual systems and continental philosophy, and dabbles in writing. You can reach her at Sriraksha.v.raghavan@gmail.com.



One of the popular Python libraries for image processing is scikit-image, an open-source collection of algorithms hosted on GitHub(1). Scikit-image has an advantage over other libraries because of the speed of its algorithms, which is essential for working with large amounts of data.

To get started with scikit-image, some understanding of the NumPy library would be beneficial but not mandatory. The easiest way to install scikit-image is via pip in your command line window(2).

Scikit-image stores images as NumPy ndarrays(n-dimensional), which are arrays of numbers with rows, columns, and dimensions. The dimensions represent the color planes of the image, such as red, green, blue, infrared, x-ray, etc. Scikit-image has various functions and classes for image processing, ranging from simple tasks like changing the color scale to complex ones like image segmentation, feature detection, and image restoration.

The best way to learn scikit-image is to download its pre-existing dataset using the function call ski.data.download_all() in your Python environment. This will give you some image sets that you can manipulate using different scikit-image functions and classes. You can also follow the tutorials available on the scikit-image website(3), which use the same datasets to demonstrate how scikit-image works.

Additionally, some useful forums to discuss scikit-image applications are their Zulip page(4), a community forum where people post queries and share ideas, and their GitHub page(1), where you can access their API and codebase.

1: scikit-image/scikit-image: Image processing in Python (https://en.wikipedia.org/wiki/Scikit-)
2: Installation — scikit-image (https://scikit-image.org/docs/stable/user_guide/install.html)
3: Tutorials — scikit-image (https://scikit-image.org/docs/stable/user_guide/tutorials.html)
4: scikit-image - Zulip Chat Archive (https://zulip.com/help/view-images-and-videos)

If you are new to,
 'pip [https://hodentekhelp.blogspot.com/2018/09/how-do-you-upgrade-pip.html]' 
or 
'Numpy [https://hodentekhelp.blogspot.com/2020/06/what-is-numpy.html]' 
you can find them in this blog in addition to other python items.