Skip to content

Instantly share code, notes, and snippets.

View NMZivkovic's full-sized avatar

Nikola Živković NMZivkovic

View GitHub Profile
<div class="toolbar" role="banner">
<img
width="55"
src="https://i.imgur.com/WQKir0M.png"
/>
<span>Tensorflow.js and Angular Integration</span>
<div class="spacer"></div>
</div>
<h2>
{{title}}
from __future__ import print_function, division
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# Keras modules
from tensorflow.keras.layers import Input, Dense, Reshape, Flatten, Dropout, BatchNormalization, Activation, ZeroPadding2D, LeakyReLU, UpSampling2D, Conv2D
from tensorflow.keras.models import Sequential, Model
from tensorflow.keras.optimizers import Adam
public class SimpleNeuralNetwork
{
private NeuralLayerFactory _layerFactory;
internal List<NeuralLayer> _layers;
internal double _learningRate;
internal double[][] _expectedResult;
/// <summary>
/// Constructor of the Neural Network.
import os
import numpy as np
from glob import glob
import scipy
import matplotlib.pyplot as plt
class ImageHelper(object):
def save_image(self, plot_images, epoch):
os.makedirs('cycle_gan_images', exist_ok=True)
titles = ['Original', 'Transformed']
public class TestClass
{
public int Id { get; set; }
}
[Fact]
public void Add_TestClassObjectPassed_ProperMethodCalled()
{
// Arrange
var testObject = new TestClass();
var context = new Mock<DbContext>();
var dbSetMock = new Mock<DbSet<TestClass>>();
context.Setup(x => x.Set<TestClass>()).Returns(dbSetMock.Object);
dbSetMock.Setup(x => x.Add(It.IsAny<TestClass>())).Returns(testObject);
class DataSetCreator(object):
def __init__(self, batch_size, image_height, image_width, dataset):
self.batch_size = batch_size
self.image_height = image_height
self.image_width = image_width
self.dataset = dataset
def _get_class(self, path):
pat_splited = tf.strings.split(path, os.path.sep)
return pat_splited[-2] == CLASS_NAMES
"""
Usage: analyse_data.py --company=<company>
"""
import warnings
import logging
import itertools
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from hmmlearn.hmm import GaussianHMM
@NMZivkovic
NMZivkovic / SOMap.cs
Last active September 7, 2020 12:56
using System;
using SOM.NeuronNamespace;
using SOM.VectorNamespace;
namespace SOM
{
public class SOMap
{
internal INeuron[,] _matrix;
internal int _height;
tfds.core.DatasetInfo(
name='ted_hrlr_translate',
version=0.0.1,
description='Data sets derived from TED talk transcripts for comparing similar language pairs
where one is high resource and the other is low resource.
',
urls=['https://github.com/neulab/word-embeddings-for-nmt'],
features=Translation({
'en': Text(shape=(), dtype=tf.string),
'ru': Text(shape=(), dtype=tf.string),