Giter VIP home page Giter VIP logo

g2-coral's Introduction

Final Project

This repository is for the final project of PHY 506 Computational Physics II. The ultimate goal is to implement the CNN model on Google Coral Dev Board / Google Edge TPU for g2 temporal correlation data analysis. Beyond the final project, this will still be worked on since there're several parts that could be improved or need to be solved.

Contents

  • Model : It contains the CNN model we developed, could be visualized on the jupyter notebook, and a .h5 file saving a Keras model.
  • Quantization : We're not able to implement the model on TPUs, due to some layers in the model are not fully quantized. This will be further investigated and several testing conveted models and a ongoing notebook about it could be found.
  • plots : Including plots for midterm milestone, though ther're not related to the final.
  • py_programme : Python files including main implementations for this project and a linting report from Pylint.
  • sdt_data : Actual measurement data files.
  • simulation : Several notebooks represent different simulation methods. We finally adopt the sdt_simulation which uses Monte Carlo Method on Tensorflow. Simulated data are included.
  • unittest : A .ipynb to see the visualization, simulated data file and a test kears model file.
  • wiki_figures : Figures and some sketches for wiki.

g2-coral's People

Contributors

carlatbuffalo avatar laserlab avatar

Watchers

James Cloos avatar  avatar

Forkers

carlatbuffalo

g2-coral's Issues

Binning issue

  1. The first bin always gets 0 event.
  2. It's not creating integer samples.
  3. The zero time bin issue.

quantization aware training

The quantization aware training fails because tf lite does not support some layers, such as conv1d, maxpool1d...

# annotate that only the Dense layers should be quantized.
def apply_quantization(layer):
    if isinstance(layer, tf.keras.layers.Dense):
        return tfmot.quantization.keras.quantize_annotate_layer(layer)
    elif isinstance(layer, tf.keras.layers.Conv1D):
        return tfmot.quantization.keras.quantize_annotate_layer(layer)
    elif isinstance(layer, tf.keras.layers.MaxPool1D):
        return tfmot.quantization.keras.quantize_annotate_layer(layer)
    return layer

annotated_model = tf.keras.models.clone_model(
    model = base_model,
    clone_function= apply_quantization )
# make the quantization aware
qaware_model = tfmot.quantization.keras.quantize_apply(base_model)

Error message:

RuntimeError: Layer conv1d_4:<class 'tensorflow.python.keras.layers.convolutional.Conv1D'> is not supported. You can quantize this layer by passing a `tfmot.quantization.keras.QuantizeConfig` instance to the `quantize_annotate_layer` API.

linting

there's no linting for the python programme !!

Stat Model Implementation

It's necessary to apply the Bayesian Model into the algorithm since we need a prediction for few-shot data to get a feedback in real-time measurements!

low accuracy of CNN

One possible reason is the strides of the optimazer is too large, which couldn't cover the dip at zero time delay.
After set it to 1 the accuracy improves.
It's also because the data generated has a g2(0) close to the ground truth 0.5, which makes it harder for the classifier

CNN model

related to #8
Currently it could only classify really 'dog-like dogs' and 'cat-like cats'.
If the source is mixed or close to the border between two classes the accuracy is pretty bad

More features

Can tune the g2(0) by adding another source (sps, thermal ....) to check how the model changes #11

bunching

there is part of g2 values larger than 1 near the zero point, which is not useful for a simulated data #11
ๅ›พ็‰‡

Only one sps

The simulation works only for one sps but once we add another sps the result does not seem correct. This needs to be solved

More data

I need more g2 data for training the model.

Simulate Thermal Source

So far the simulation only have sps, coherent laser and non-detected options. The thermal source case needs to be added.

CNN

design a CNN model

LM fitting

I need to do a Levenberg-Marquardt fitting in one of the data to see the ML speedup.

Add references

I need to figure out all references:

  • where to add: after each "claim" sentence
  • find the related paper/ source
  • also add them in the video

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.