This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.IceKontroI.MODEL_TEST; | |
import org.deeplearning4j.nn.conf.ComputationGraphConfiguration; | |
import org.deeplearning4j.nn.conf.NeuralNetConfiguration; | |
import org.deeplearning4j.nn.conf.inputs.InputType; | |
import org.deeplearning4j.nn.conf.layers.DenseLayer; | |
import org.deeplearning4j.nn.conf.layers.OutputLayer; | |
import org.deeplearning4j.nn.graph.ComputationGraph; | |
import org.nd4j.linalg.api.buffer.DataBuffer; | |
import org.nd4j.linalg.api.ndarray.INDArray; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package nqueens | |
import org.junit.runner.RunWith | |
import org.scalatest.FunSuite | |
import org.scalatest.junit.JUnitRunner | |
@RunWith(classOf[JUnitRunner]) | |
class NqueensTest extends FunSuite { | |
// test("string take") { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package nqueens | |
object Nqueens extends App { | |
println((nQueens(100) map show) mkString "\n") | |
def isValid(partialSolution: List[Int], col: Int, n: Int): Boolean = { | |
val partialSolutionCoords = (0 until partialSolution.length) zip partialSolution.reverse | |
val partial = partialSolutionCoords.toSet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package recfun.week3 | |
import com.fasterxml.jackson.databind.JsonNode | |
import scala.collection.JavaConversions._ | |
import com.fasterxml.jackson.module.scala.DefaultScalaModule | |
import com.fasterxml.jackson.databind.ObjectMapper | |
import scala.util.parsing.json.JSON | |
object JsonParsing { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division | |
import pylab | |
import numpy as np | |
""" | |
This script visualizes a trend in linear-like-shaped data | |
generated with random noise. | |
""" | |
# generate linear like function (with noise) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyspark import SparkContext, SparkConf | |
from pyspark.sql import SQLContext | |
from pyspark.sql.types import * | |
import json | |
import re | |
api_pattern = re.compile(r'(POST|HEAD|GET).*HTTP......[0-9]*.[0-9]*') | |
def matcher( str ): | |
match = api_pattern.search(str) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From this little example created by myself I learned, that it is always important to think in the distributed MapReduce paradigm when getting hands on spark. | |
Operations that are costly calculations in a centralized manner should be avoided on the cluster. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division | |
import numpy as np | |
from matplotlib import pyplot as plt | |
from scipy.stats import norm | |
import pandas as pd | |
import csv as csv | |
import seaborn as sns | |
from numpy import matrix, mat | |
import re |