Git Product home page Git Product logo

colab's Introduction

Back up my notebooks on Google Colab

After discovering the usefulness of Google Colab, I ran some small programs there as practice. Some of them were interesting, so I moved them to this GitHub repository to share.

These notebooks are currently divided into the following categories:

  • Pytorch Tutorial Series
  • Visualizing Stocks

Pytorch Tutorial Series

This Colab notebook files of PytorchTutorial series includes the following:

I initially copied and pasted these files from Professor Mofan's teaching website to Colab for code verification and familiarization with PyTorch.

After performing a lot of refactoring, I also added new features for them.The original example code's visualization was through Matplotlib, to better compatibility with Colab, I added a Plotly version. Both are side by side, allowing for easy comparison.

The following chart is the final result from PytorchTutorial7_CNN.ipynb, which is a CNN model trained using PyTorch in Google Colab to recognize the Arabic numerals 0 to 9 in the MNIST dataset. During the process, it was dimensionality reduced using TSNE and visualized using Plotly.

PT7_VisualizeLastLayer


Visualizing Stocks

Initially, just for fun, I gave ChatGPT a simple task, to write a program to draw basic charts such as candlesticks, moving average lines, and volume. However, after ChatGPT struggled for a whole day, it still couldn't produce accurate results. So I had to roll up my sleeves, with the assistance of ChatGPT, and spend two days studying Plotly to finally achieve the current result. The following is its Colab notebook file.

I retrieve the historical data of a stock using yfinance, after obtaining the stock's DataFrame table, I plot related charts using both mplfinance (a Matplotlib utilities for the visualization, and visual analysis, of financial data) and Plotly. I also tried using TA-Lib with mplfinance to plot technical analysis indicators.

As an example, below are the TSLA's price and volume accumulation charts so-called Volume Profile (or Price-by-Volume), the first one is plotted using mplfinance and the latter two are plotted using Plotly.

TSLA_20230203_VolumeProfile_mpl TSLA_20230207_VolumeProfile_Plotly2s TSLA_20230203_VolumeProfile_Plotly

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.