/* ---- Google Analytics Code Below */
Showing posts with label Python. Show all posts
Showing posts with label Python. Show all posts

Tuesday, May 30, 2023

LangChain intro at Work

Taking a look at LangChain, see below, with link to detail.

Getting Started with LangChain: A Beginner’s Guide to Building LLM-Powered Applications

A LangChain tutorial to build anything with large language models in Python

From Towards Data Science,  by Leonie Monigatti   ... 

https://github.com/hwchase17/langchain  (technical)


Thursday, May 25, 2023

Mojo Lang, New programming language

New to me, a superset of Python 

Mojo Lang: The New Programming Language

Introducing Mojo Lang, the new programming language designed as a superset of Python.

By Nisha Arya, KDnuggets on May 12, 2023 in Programming

Just when we thought things couldn’t shake up the tech industry anymore, welcome the new programming language that has been designed as a superset of the Python programming language.

Python still ranks high as one of the most popular programming languages due to its ability to create complex applications using simple and readable syntax. However, if you use Python, you know its biggest challenge is speed. Speed is an important element of programming, therefore does Python's great ability to produce complex applications with easy syntax dismiss its lack of speed? Unfortunately no. 

There are other programming languages such as C or C++, which have incredible speed, and higher performance in comparison to Python. Although Python is the most widely used programming language for AI, if speed is what you’re looking for, the majority of people stick with C, Rust, or C++.

But that may all change, with the new programming language Mojo Lang.

What is Mojo Lang?

The creator of Mojo Lang, Chris Latner, the creator of the Swift programming language and the LLVM Compiler Infrastructure has taken the usability of Python and merged it with the performance of the C programming language. This has unlocked a new level of programming for all AI developers with unparalleled programmability of AI hardware and the extensibility of AI models.

In comparison to Python, PyPy is ??22x, Scalar C++ is 5000x, and Mojo Lang is 35000x faster. 

Mojo Lang is a language that has been designed to program on AI hardware, such as GPUs running CUDA. It is able to achieve this by using Multi-Level Intermediate Representation (MLIR) to scale hardware types, without complexity. 

Mojo Lang is a superset of Python, which means that it does not require you to learn a new programming language. Handy, right? The base language is fully compatible with Python and allows you to interact with the Python ecosystem and make use of libraries such as NumPy.   ... '

Saturday, May 13, 2023

AI self-play for Algorithm Design

AI and Puzzles..

AI self-play for algorithm design   in Microsoft.com

Published May 2, 2023

By Adam Tauman Kalai , Senior Principal Researcher  Patrick Haluptzok , AI Research Associate

A self-play pipeline for a language model (LM) to improve itself in a fully automatic manner. First, the LM generates novel puzzles based on a training set of handwritten puzzles. Then, the LM attempts to solve each of these puzzles 100 times. In Step 3, the computer (specifically a Python interpreter) filters the candidate solutions for correctness. Finally, the LM is improved by further training on these verified correct solutions to synthetic puzzles, and the process repeats. This process leads to significant improvements as measured on held-out test puzzles, which were also handwritten.

Efficient algorithms are crucial for many purposes, including reducing energy consumption in digital devices. While humans outperform AI systems at designing such algorithms, we show how to improve AI programming abilities using self-play, a technique that has helped AI systems dominate in games such as chess and Go.

Designing fast and accurate algorithms requires high-level abstract reasoning, which remains difficult for AI systems. Our approach involves having the AI design and solve its own programming challenges, enabling practice on millions of artificial challenges and exploration of problem types not found in public repositories. We detail our work in a new paper, “Language Models Can Teach Themselves to Program Better,” which we’re presenting at the 2023 International Conference on Learning Representations (ICLR).  ... '

Saturday, September 18, 2021

Machine Learning Developed in Space

We have used computers in space for a long term, now a continuation of developing code there.

Raspberry Pi Heading into Space for Python Programming Challenge

ZDNet, Liam Tung, September 14, 2021

Upgraded Raspberry Pi computers will return to the International Space Station (ISS) for use in what the European Space Agency (ESA) calls the Mission Zero and Mission Space Lab challenges. Mission Zero invites coders to write a Python algorithm to take a humidity reading onboard the ISS that is shown to the astronauts with a personalized message. ESA said Mission Space Lab challenges teams of young people "to design and write a program for a scientific experiment that enhances our understanding of either life on Earth or life in space." The new Astro Pi units are Raspberry Pi 4 Model B featuring 8 GB of memory, a camera, a machine learning accelerator, sensors, gyroscope, accelerometer, magnetometer, and a light-emitting diode matrix for visual feedback. ESA said the accelerator will allow teams "to develop machine learning models enabling high-speed, real-time processing."

Friday, August 06, 2021

Python Code Libraries Riddled with Holes

Take caution with all those handy libraries.

Python Code Libraries Are Riddled With Security Holes  By TechRadar, August 2, 2021

Almost half of the packages in the official Python Package Index (PyPI) repository have at least one security issue, according to an analysis by researchers at the University of Turku in Finland.

Over 749,000 security issues were found in 197,000 open source packages examined with static analysis, which could taint the software that use them, the researchers say. They describe their work in "A Large-Scale Security-Oriented Static Analysis of Python Packages in PyPI.

Despite the inherent limitations of static analysis, the researchers still found at least one security issue in about 46% of the packages in the repository, or an average of 3.8 issues per package. Of the identified issues, 442,373 of low severity were found in 64.2 percent of packages, while 227,426 of moderate severity, or an average of 1.2 per package, were found. And 11% of the flagged PyPI packages have 80,065 high severity issues, or an average of 0.4 per package.

In June, PyPI was purged of half a dozen typosquatting packages that contained cryptomining malware, and a month before that the repository was flooded with spam packages.

From TechRadar   View Full Article

Sunday, June 20, 2021

Why Python as Most Common AI Language?

Still think Low and No-code are advancing, but for now Python reigns.

Three Reasons Python Is The AI Lingua Franca

By Calvin Hendryx-Parker   in Datanami

Earlier this year, Python celebrated its 30th anniversary as a programming language. For any software language to last three decades and maintain relevance to developers of all stripes is something special.

Much of what made Python a spectacular achievement when Guido van Rossum released version 0.9.0 in 1991 informs its success today. Python has always been simple and consistent, offering readable code and an entry ramp for developers learning a new language. These aspects of the language, along with its “batteries included” philosophy, paved the way for amateurs and professionals alike to push the boundaries of open source software programming over the last 30 years.

Recently, this has meant integration of artificial intelligence (AI) and machine learning (ML). Python’s initial release came before AI was a broadly accessible business tool, but quite a lot has changed since 1991. The 1996 chess match between IBM’s Deep Blue and Grand Champion Gary Kasparov demonstrated that AI was capable of complex algorithmic problem solving at levels well above even the most skilled human beings. Thereafter, the business of AI began to boom. The market for AI/ML in software development is growing at a rapid pace as AI streamlines industries as diverse as insurance and higher education. According to a Fortune Business Insights report from July 2020, the market size of the global AI market was valued at about $27 billion in 2019 and is projected to reach more than $250 billion by 2027.

Developers should expect AI/ML projects to comprise a greater and greater amount of their overall work in the coming years, and the time is now to learn the best language for artificial intelligence: Python. What makes Python so well-suited to AI and ML? Here are three reasons why Python can be the most important tool in your AI toolbox.    ... 

Wednesday, June 09, 2021

Automating Excel with Python

 Nice idea.  In fact can think of several application examples where we were appending to capabilities of existing spreadsheets.   One a much used, almost historical example.  Could have led to quicker prototypes at least.  Pre-familiarity to the data in the spreadsheets.  Our coders probably would not want to deal with excel, but it still has useful capabilities:

Automate Your Excel Using Python

From manual to an automated approach  By Pranjal Saxena

 Python is an amazing programming language. It is easier to learn and adapt. The error messages in python are self-explainable. We don’t need to invest hours to find the solution to our error message. That’s why I love this programming language.

I think this should be the ideal programming language. A programming language's goal should be to help us build exciting products, not wasting time in solving errors.

Recently, I have learned about automating excel tasks using python. I thought of sharing those amazing tricks with a wider audience. This automating strategy use python programming. The good thing is — each line of python code is self explainable that you don’t need to google anything.

You can use the code editor of your choice. In this article, I will be using the Jupyter Notebook for demonstration purpose.   ..... (details below at the link) 

Monday, February 01, 2021

Odoo ERP System

Odoo Python based ERP system, with free and subscription based versions.    

Odoo is a suite of business management software tools including CRM, e-commerce, billing, accounting, manufacturing, warehouse, project management, and inventory management to name a few. The Community version is a libre software, licensed under the GNU LGPLv3. Wikipedia ... 

Operating system: Linux, Unix-like, OS X, Windows, iOS, Android

Stable release: 14.0 / October 2, 2020; 3 months ago

Preview release: master

Initial release date: February 2005

Programming languages: Python, JavaScript, XML

Default port: 8069 odoo.com .... 

Sunday, May 24, 2020

Microsoft LearnTV: Python Coding

I was just asked about a simple intro to Python.   There are many out there, but I noticed that the just introduced Microsoft LearnTV has a video on it. see: 

I good intro and also an example of LearnTV.

Take your first steps with Python
4 hr 33 min
Learning Path

Interested in learning a programming language but aren't sure where to start? Start here! Learn the basic syntax and thought processes required to build simple applications using Python.

In this learning path, you'll:

Write your first lines of Python code
Store and manipulate data to modify its type and appearance
Execute built-in functionality available from libraries of code
Add logic to your code to enable complex business functionality
Once you complete this learning path, you will have a great foundation to build upon in subsequent Python Learning Paths. ... "

Sunday, January 26, 2020

Numba: Speeding up Python

Just brought to my attention.  Python use for numerical algorithms can be an issue when speed is required.  Technical.

Accelerate Python Functions
Numba translates Python functions to optimized machine code at runtime using the industry-standard LLVM compiler library. Numba-compiled numerical algorithms in Python can approach the speeds of C or FORTRAN.

You don't need to replace the Python interpreter, run a separate compilation step, or even have a C/C++ compiler installed. Just apply one of the Numba decorators to your Python function, and Numba does the rest.  .... " 

Friday, November 01, 2019

Agent Based Mesa Models in Python

This is new to me.    We actively used agent models for consumer interaction understanding.  See agent tag for more.

Introduction to Mesa: Agent-based Modeling in Python
Ng Wai Foong

Python-based alternative to NetLogo, Repast, or MASON for agent-based modeling

Simulation result showing segregation between blue and red agent

Agent-based modeling relies on simulating the actions and interactions of autonomous agents to evaluate their effects on the system. It is often used to predict the projections that we will obtain given a complex phenomena. The main purpose is to obtain explanatory insight on how the agents will behave given a particular set of rules. Agent-based modeling has been extensively used in numerous industry such as biology, social sciences, network and business. This article covers the necessary steps to kick-start your agent-based modeling project using an open-source python module called Mesa. There are 4 sections in this tutorial:   ... " 

Thursday, October 10, 2019

Rolling Your Own Neural Network

Seen several of these tutorials now interlaced with all concepts, math and code.  This one seems nicely done.   When we first played with these in the 80s we wrote our own from bottom up code, now you can roll your own with libraries quite easily.

Build an Artificial Neural Network(ANN) from scratch: Part-1
Towards Data Science by Nagesh Singh Chauhan 

This article focused on building an Artificial Neural Network using numpy python library. ... 

Friday, September 06, 2019

Build Your Own Voice Assistant

A look at building your own Voice Assistant from KDNuggets, instructive about how relatively little it takes to set up the basics using Python.   Of course setting it in a complete ecosystem requires quite a few additional details.   Below just the intro, more at the link:

Hone your practical speech recognition application skills with this overview of building a voice assistant using Python.    By Nagesh Chauhan, Big data developer at CirrusLabs

Introduction
Who doesn't want to have the luxury to own an assistant who always listens for your call, anticipates your every need, and takes action when necessary? That luxury is now available thanks to artificial intelligence-based voice assistants.

Voice assistants come in somewhat small packages and can perform a variety of actions after hearing your command. They can turn on lights, answer questions, play music, place online orders and do all kinds of AI-based stuff.   

Voice assistants are not to be confused with virtual assistants, which are people who work remotely and can, therefore, handle all kinds of tasks. Rather, voice assistants are technology based. As voice assistants become more robust, their utility in both the personal and business realms will grow as well.

What is a Voice Assistant?

A voice assistant or intelligent personal assistant is a software agent that can perform tasks or services for an individual based on verbal commands i.e. by interpreting human speech and respond via synthesized voices. Users can ask their assistants’ questions, control home automation devices, and media playback via voice, and manage other basic tasks such as email, to-do lists, open or close any application etc with verbal commands.

Let me give you the example of Braina (Brain Artificial) which is an intelligent personal assistant, human language interface, automation and voice recognition software for Windows PC. Braina is a multi-functional AI software that allows you to interact with your computer using voice commands in most of the languages of the world. Braina also allows you to accurately convert speech to text in over 100 different languages of the world.  .... " 

Tuesday, August 06, 2019

Microsoft Makes AI Debugging Tool Open Source

And with similarities to Google's What-If tool, Microsoft has made its debugging tool open source.  Have not seen this one directly as yet,  but this is NOT a No-code solution, likely making it harder for management to understand.

Microsoft Open-Sources TensorWatch AI Debugging Tool   by Anthony Alford in InfoQ

Microsoft Research open-sourced TensorWatch, their debugging tool for AI and deep-learning. TensorWatch supports PyTorch as well as TensorFlow eager tensors, and allows developers to interactively debug training jobs in real-time via Jupyter notebooks, or build their own custom UIs in Python.

In a recent blog post, a research team led by Shital Shah announced the open-source release of TensorWatch. TensorWatch is a Python library for visualizing data from all phases of the deep-learning model-development cycle: from model structure, to training metrics, to explanation of model predictions. TensorWatch is designed to be used as an interactive tool in Jupyter notebooks or JupyterLab dashboards, but as a Python library it can also be included in custom tools and UIs. According to the development team:

"We like to think of TensorWatch as the Swiss Army knife of debugging tools with many advanced capabilities researchers and engineers will find helpful in their work."  ... " 

More from the MS Research Blog.

Wednesday, May 08, 2019

Writing Computer Code by Voice

Would have thought this would be very difficult to do, given the required syntactic accuracy required for coding.   So a fascinating case study and demonstration video:

Code Talkers    By Neil Savage 
Communications of the ACM, May 2019, Vol. 62 No. 5, Pages 18-19   10.1145/3317681

When Tavis Rudd decided to build a system that would allow him to write computer code using his voice, he was driven by necessity.

In 2010, he tore his rotator cuffwhile rock-climbing, forcing him to quit climbing while the injury healed. Rather than sitting idle, he poured more of his energy into his work as a self-employed computer programmer. "I'd get in the zone and just go for hours," he says. Whether it was the increased time pounding away at a keyboard or the lack of other exercise, Rudd eventually developed a repetitive strain injury (RSI) that caused his outer fingers to go numb and cold, leaving him unable to type/code without pain.

Worried that he would not be able to do his job, Rudd turned to Dragon Naturally Speaking voice recognition software to see if that could help. He quickly discovered that he could insert commands into Dragon using the programming language Python, and that he could use the Python-based application programming interface (API) Dragonfly to create lists of words and link them to specific actions he wanted Dragon to perform.

So he set about creating such a list, known as a grammar, of words that would cause a text editor such as Emacs to take certain actions—insert or delete characters, add a bracket, move the cursor up some number of lines. He created this grammar with strange words, such as ak or par, to avoid confusing the speech recognition software with common English words and to keep the number of syllables per command down to one or two, so programming this way would be speedy. .... " 

Monday, April 29, 2019

How Python is used at Netflix

An instructive piece in the Netflix tech blog.   Netflix has to reliably delivery large amounts of data, personalized to millions of consumers, reliably and securely.    While gathering information to tailor their sales and marketing to these same consumers.  See how they use Python and development support architectures.  Considerable piece, mostly technical.

Python at Netflix
 Netflix Technology Blog   By Pythonistas at Netflix, coordinated by Amjith Ramanujam and edited by Ellen Livengood

As many of us prepare to go to PyCon, we wanted to share a sampling of how Python is used at Netflix. We use Python through the full content lifecycle, from deciding which content to fund all the way to operating the CDN that serves the final video to 148 million members. We use and contribute to many open-source Python packages, some of which are mentioned below. If any of this interests you, check out the jobs site or find us at PyCon. We have donated a few Netflix Originals posters to the PyLadies Auction and look forward to seeing you all there.  ... " 

Tuesday, December 11, 2018

Python Tricks

Beginner Python Coding tricks.  Whenever you start a new language, its nice to see lots of relatively simple examples that relate to the kinds of things you might want to do.  This is kind of like that, for beginners, but has a few things that even the expert can appreciate.   Also useful for an overview of the language for those not planning to code.

Thursday, September 20, 2018

How to Code in Python 3

Passing this along to some friends

Well done,  relatively non-technical,  especially useful if you have coded in previous languages where you had to construct numeric and related algorithms.   lists and structural  ...  There are now many resources on coding in Python, search them out.

The major section uses linux environments, but they also have a section for more typical environments, here for Windows 10.

https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-local-programming-environment-on-windows-10

https://www.digitalocean.com/community/tutorial_series/how-to-code-in-python-3

Wednesday, September 19, 2018

Talk: AI Fairness 360: Python Package

How to look at biases when your making AI driven decisions about people.

Invitation to the ISSIP Cognitive Systems Institute Group Webinar

 Slides and Recording: http://cognitive-science.info/community/weekly-update/

Date and Time: September 20, 2018 - 10:30am US Eastern
Talk Title: AI Fairness 360

Speaker: Kush Varshney, IBM
Talk Description:  
Machine learning models are increasingly used to inform high stakes decisions about people. Although machine learning, by its very nature, is always a form of statistical discrimination, the discrimination becomes objectionable when it places certain privileged groups at systematic advantage and certain unprivileged groups at systematic disadvantage. Biases in training data, due to either prejudice in labels or under-/over-sampling, yields models with unwanted bias.In this presentation, we introduce AI Fairness 360, a new Python package that includes a comprehensive set of metrics for datasets and models to test for biases, explanations for these metrics, and algorithms to mitigate bias in datasets and models. They have developed the package with extensibility in mind.  They encourage the contribution of your metrics, explainers, and debiasing algorithms. Please join the community to get started as a contributor.

Bio: 
Kush R. Varshney was born in Syracuse, NY in 1982. He received the B.S. degree (magna cum laude) in electrical and computer engineering with honors from Cornell University, Ithaca, NY, in 2004. He received the S.M. degree in 2006 and the Ph.D. degree in 2010, both in electrical engineering and computer science from the Massachusetts Institute of Technology (MIT), Cambridge.  While at MIT, he was a National Science Foundation Graduate Research Fellow.Dr. Varshney is a principal research staff member and manager with IBM Research AI at the Thomas J. Watson Research Center, Yorktown Heights, NY, where he leads the Learning and Decision Making group.  He is the founding co-director of the IBM Science for Social Good initiative.  He applies data science and predictive analytics to human capital management, healthcare, olfaction, computational creativity, public affairs, international development, and algorithmic fairness, which has led to recognitions such as the 2013 Gerstner Award for Client Excellence for contributions to the WellPoint team and the Extraordinary IBM Research Technical Accomplishment for contributions to workforce innovation and enterprise transformation. He conducts academic research on the theory and methods of statistical signal processing and machine learning. His work has been recognized through best paper awards at the Fusion 2009, SOLI 2013, KDD 2014, and SDM 2015 conferences. He is a senior member of the IEEE and a member of the Partnership on AI's Safety-Critical AI working group.

Date and Time : September 20 2018 - 10:30am US Eastern
Zoom meeting Link: https://zoom.us/j/7371462221
Zoom Callin: (415) 762-9988 or (646) 568-7788 Meeting id 7371462221
Zoom International Numbers: https://zoom.us/zoomconference
(Check the website in case the date or time changes: http://cognitive-science.info/community/weekly-update/ )

Please retweet  -

Join LinkedIn Group https://www.linkedin.com/groups/6729452

Sunday, August 26, 2018

What and Why are ARCH and GARCH?

When you do time series forecasting you almost always get changes in variance over time.  Sometimes enough to invalidate your decisions and conclusions.  We used these  methods in key ways to produce better results over time.  Somehow I rarely hear these methods mentioned recently.  Here Jason Brownlee provides a good Python based intro.  Fairly non-technical, but coding based.

How to Model Volatility with ARCH and GARCH for Time Series Forecasting in Python by Jason Brownlee   in Time Series

A change in the variance or volatility over time can cause problems when modeling time series with classical methods like ARIMA.

The ARCH or Autoregressive Conditional Heteroskedasticity method provides a way to model a change in variance in a time series that is time dependent, such as increasing or decreasing volatility. An extension of this approach named GARCH or Generalized Autoregressive Conditional Heteroskedasticity allows the method to support changes in the time dependent volatility, such as increasing and decreasing volatility in the same series.

In this tutorial, you will discover the ARCH and GARCH models for predicting the variance of a time series.

After completing this tutorial, you will know:

The problem with variance in a time series and the need for ARCH and GARCH models.
How to configure ARCH and GARCH models.
How to implement ARCH and GARCH models in Python.
Let’s get started.   .... "