Skip to content

Instantly share code, notes, and snippets.

View hesoyamcode's full-sized avatar
💭
I may be slow to respond.

fu hesoyamcode

💭
I may be slow to respond.
  • Singapore
View GitHub Profile
@hesoyamcode
hesoyamcode / git log graph
Created May 26, 2018 10:44
The --graph flag that will draw a text based graph of the commits on the left hand side of the commit messages. --decorate adds the names of branches or tags of the commits that are shown. --oneline shows the commit information on a single line making it easier to browse through commits at-a-glance.
git log --graph --decorate --oneline
{
"presets": [
"env"
]
}
@hesoyamcode
hesoyamcode / command
Created June 21, 2018 15:46
Accessing Shell Node Docker
Node:latest
docker exec -it container_name /bin/bash
node:alpine
docker exec -it container_name /bin/sh
@hesoyamcode
hesoyamcode / command
Last active June 21, 2018 15:47
Docker ps -s
The "size" and "virtual size" describe the amount of disk space used by a container. Let me try and explain:
When starting a container, the image that the container is started from is mounted read-only. On top of that, a writable layer is mounted, in which any changes made to the container are written.
The read-only layers of an image can be shared between any container that is started from the same image, whereas the "writable" layer is unique per container (because: you don't want changes made in container "a" to appear in container "b" 😄)
Back to the docker ps -s output;
- The "size" information shows the amount of data (on disk) that is used for the writable layer of each container
- The "virtual size" is the amount of disk-space used for the read-only image data used by the container.
@hesoyamcode
hesoyamcode / word2vec
Created June 27, 2018 20:39
Word2Vec
from gensim.models.word2vec import Word2Vec
from sklearn.manifold import TSNE
from sklearn.datasets import fetch_20newsgroups
import re
import matplotlib.pyplot as plt
# download example data ( may take a while)
train = fetch_20newsgroups()
def clean(text):
@hesoyamcode
hesoyamcode / terminal
Created July 1, 2018 18:42
Remove .DS_Store
cd into directory you want to remove .DS_Store
then type
find . -name '.DS_Store' -type f -delete
@hesoyamcode
hesoyamcode / Progressive Image React
Created July 23, 2018 07:14
Progressive Image with React
import React, { Component } from 'react';
import PropTypes from 'prop-types';
class ProgressiveImage extends Component {
static propTypes = {
preview: PropTypes.string,
image: PropTypes.string
};
state = {
Actually - there is no a good answer to your question. Most of the architectures are usually carefully designed and finetuned during many experiments.
I could share with you some of the rules of thumbs one should apply when designing its own architecture:
Avoid a dimension collapse in the first layer. Let's assume that your input filter has a (n, n) spatial shape for RGB image.
In this case, it is a good practice to set the filter numbers to be greater than n * n * 3 as this is the dimensionality of the input of a single filter.
If you set smaller number - you could suffer from the fact that many useful pieces of information about the image are lost due to initialization which dropped informative dimensions.
Of course - this is not a general rule - e.g. for a texture recognition, where image complexity is lower - a small number of filters might actually help.
Think more about volume than filters number - when setting the number of filters it's important to think about the volume change instead of the chang
*
* Migration
*/
'use strict';
module.exports = {
up: function(queryInterface, Sequelize) {
return queryInterface.createTable('Users', {
firstName: {
type: Sequelize.STRING
},
CREATE TABLE `apps_countries` (
`id` int(11) NOT NULL auto_increment,
`country_code` varchar(2) NOT NULL default '',
`country_name` varchar(100) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Dumping data for table `apps_countries`
--
INSERT INTO `apps_countries` VALUES (null, 'AF', 'Afghanistan');