Skip to content

Instantly share code, notes, and snippets.

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

simon pure-rgb

💭
I may be slow to respond.
View GitHub Profile
@innat
innat / XNet TF.Keras 1.py
Last active April 3, 2023 07:49
Official Implementation of UNet++ (EfficientNets) in TensorFlow 2
import numpy as np
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import Model, Input
from tensorflow.keras.layers import Conv2DTranspose
from tensorflow.keras.layers import UpSampling2D
from tensorflow.keras.layers import Conv2D
from tensorflow.keras.layers import BatchNormalization
from tensorflow.keras.layers import Activation
from tensorflow.keras.layers import Concatenate

Step by step tuts to setup apache spark ( pyspark ) on linux and setup environment for deep learning with Apache Spark using Deep-Learning-Pipelines.

Step 1 : Install Python 3 and Jupyter Notebook

Run following command. Someone may need to install pip first or any missing packages may need to download.

sudo apt install python3-pip sudo pip3 install jupyter

@innat
innat / 4Data.md
Created November 12, 2018 18:14
4D - Four Dimensional Data

Let's consider a folowing 4D matrix.

import numpy as np
W = np.random.randn(2,2,3,100)

print(W.shape)

output:
@innat
innat / DotMultiply.md
Last active September 6, 2024 21:38
In Python np.dot and np.multiply with np.sum
@innat
innat / FilterMap.md
Last active November 24, 2018 15:50
Python: Difference between filter(function, sequence) and map(function, sequence)

map and filter function in python is pretty different because they perform very differently. Let's have a quick example to differentiate them.

map function

Let's define a function which will take a string argument and check whether it presents in vowel letter sequences.

def lit(word):
    return word in 'aeiou'

Now let's create a map function for this and pass some random string.

@innat
innat / ImageCenter.md
Created November 11, 2018 23:05
Center Images in GitHub README.md

For left alignment

 <img align="left" width="600" height="200" src="https://www.python.org/python-.png">

For right alignment

<img align="right" width="600" height="200" src="https://www.python.org/python-.png">

And for center alignment

@innat
innat / Delete Key.md
Last active November 24, 2018 15:51
Removing Key from Python Dictionary.

We can delete a key from a Python dictionary by the some following approaches.

Using the del keyword; it's almost the same approach like you did though -

     myDict = {'one': 100, 'two': 200, 'three': 300 }
     print(myDict)  # {'one': 100, 'two': 200, 'three': 300}
     if myDict.get('one') : del myDict['one']
     print(myDict)  # {'two': 200, 'three': 300}
@innat
innat / NumPad.md
Last active November 24, 2018 15:51
Explaining Padding using NumPy

NumPy 1.7 (when np.pad was added) is pretty old now (it was released in 2013) so even though the question asked for a way without that function I thought it could be useful to know how that could be achieved using np.pad.

It's actually pretty simple:

>>> import numpy as np
>>> a = np.array([[ 1.,  1.,  1.,  1.,  1.],
...               [ 1.,  1.,  1.,  1.,  1.],
...               [ 1.,  1.,  1.,  1.,  1.]])
>>> np.pad(a, [(0, 1), (0, 1)], mode='constant')

array([[ 1., 1., 1., 1., 1., 0.],

Some GitHub Extensions that I use. They may also enable you to improve your productivity on GitHub.

  1. Octotree allows easy exploration of the source code within the browser through a panel on the left.

chrome-github

2 github-dashboard provides the ability to filter events on the Github.com activity dashboard.

i