Skip to content

Instantly share code, notes, and snippets.

View lucasjinreal's full-sized avatar
🎯
Focusing

MagicSource lucasjinreal

🎯
Focusing
  • Google
  • Sanfancisco
View GitHub Profile
@lucasjinreal
lucasjinreal / container_transition.dart
Created March 14, 2020 03:03
open container animation
// Copyright 2019 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:animations/animations.dart';
const String _loremIpsumParagraph =
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod '
'tempor incididunt ut labore et dolore magna aliqua. Vulputate dignissim '
@lucasjinreal
lucasjinreal / model.py
Created May 11, 2017 09:43
Minimal Implementation of TensorFlow models.
# -*- coding: utf-8 -*-
# file: models.py
# author: JinTian
# time: 11/05/2017 3:03 PM
# Copyright 2017 JinTian. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@lucasjinreal
lucasjinreal / train.py
Created May 11, 2017 07:11
Sketelon of train tensorflow pipline.
import os
import sys
import numpy as np
import tensorflow as tf
import logging
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(filename)s line:%(lineno)d %(levelname)s %(message)s',
datefmt='%Y-%m-%d %H:%M:%S')
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(filename)s line:%(lineno)d %(levelname)s %(message)s',
datefmt='%a, %d %b %Y %H:%M:%S')
import torch
def load_previous_model(encoder, decoder, checkpoint_dir, model_prefix):
"""
this can generally used in PyTorch to load previous model,
this function will find max epoch from checkpoints dir, for other models
just change model load format.
:param encoder:
:param decoder:
@lucasjinreal
lucasjinreal / notebook_to_python.py
Created May 9, 2017 07:59
Convert iPython Notebook to Pure Python Code
# -*- coding: utf-8 -*-
# file: notebook_to_python.py
# author: JinTian
# time: 09/05/2017 3:28 PM
# Copyright 2017 JinTian. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#