elephas | Distributed Deep learning with Keras & Spark

 by   maxpumperla Python Version: 3.2.0 License: MIT

kandi X-RAY | elephas Summary

kandi X-RAY | elephas Summary

elephas is a Python library typically used in Big Data, Deep Learning, Tensorflow, Keras, Spark applications. elephas has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has high support. You can install using 'pip install elephas' or download it from GitHub, PyPI.

Elephas brings deep learning with Keras to Spark. Elephas intends to keep the simplicity and high usability of Keras, thereby allowing for fast prototyping of distributed models, which can be run on massive data sets. For an introductory example, see the following iPython notebook. ἐλέφας is Greek for ivory and an accompanying project to κέρας, meaning horn. If this seems weird mentioning, like a bad dream, you should confirm it actually is at the Keras documentation. Elephas also means elephant, as in stuffed yellow elephant. Elephas implements a class of data-parallel algorithms on top of Keras, using Spark's RDDs and data frames. Keras Models are initialized on the driver, then serialized and shipped to workers, alongside with data and broadcasted model parameters. Spark workers deserialize the model, train their chunk of data and send their gradients back to the driver. The "master" model on the driver is updated by an optimizer, which takes gradients either synchronously or asynchronously.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              elephas has a highly active ecosystem.
              It has 1560 star(s) with 309 fork(s). There are 101 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 7 open issues and 151 have been closed. On average issues are closed in 759 days. There are no pull requests.
              OutlinedDot
              It has a negative sentiment in the developer community.
              The latest version of elephas is 3.2.0

            kandi-Quality Quality

              elephas has 0 bugs and 0 code smells.

            kandi-Security Security

              elephas has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              elephas code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              elephas is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              elephas releases are available to install and integrate.
              Deployable package is available in PyPI.
              Build file is available. You can build the component from source.
              Installation instructions, examples and code snippets are available.
              It has 2760 lines of code, 250 functions and 56 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed elephas and discovered the below as its top functions. This is intended to give you an instant insight into elephas implemented functionality, and help decide if they suit your requirements.
            • Process a docstring
            • Count the number of leading spaces in a string
            • Process a list block
            • Start the Flask service
            • Release the lock
            • Acquire a read lock
            • Render a function
            • Process docstring
            • Compute the keras model
            • Fit the model
            • Transform a Pandas DataFrame into a numpy array
            • Convert a vector
            • Train the model
            • Subtract two parameters
            • Return the parameters
            • Listen for incoming messages
            • Convert a class to a source link
            • Convert features to a pandas dataframe
            • Update parameters
            • Return the signature of a class
            • Estimates the model from labeled points
            • Load data from a CSV file
            • Fit the model
            • Convert features and labels to LabeledPoints
            • Collect method methods
            • Read page data
            • Create a simple RDD of features and labels
            • Start the server
            Get all kandi verified functions for this library.

            elephas Key Features

            No Key Features are available at this moment for elephas.

            elephas Examples and Code Snippets

            Elephas File System,Example,efs-client
            C++dot img1Lines of Code : 23dot img1no licencesLicense : No License
            copy iconCopy
            ./efs-client.exe
              ______     ______   ______
             /\  ___\   /\  ___\ /\  ___\
             \ \  __\   \ \  __\ \ \___  \
              \ \_____\  \ \_\    \/\_____\
               \/_____/   \/_/     \/_____/
            
            
            ---------- account  ----------
             namenode_addr: 192.168.0.179
             namenode_port:   
            Elephas File System,Example,Start DataNode
            C++dot img2Lines of Code : 2dot img2no licencesLicense : No License
            copy iconCopy
            ./efs-server datanode DataNodeConfig01.yaml
            ./efs-server datanode DataNodeConfig02.yaml
              
            Elephas File System,Example,Start NameNode
            C++dot img3Lines of Code : 1dot img3no licencesLicense : No License
            copy iconCopy
            ./efs-server namenode NameNodeConfig.yaml
              
            Best practice for feeding spark dataframes for training Tensorflow network
            Pythondot img4Lines of Code : 44dot img4License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            class MyGenerator(object):
                def __init__(self, spark_df, buffer_size, feature_col='features', label_col='labels'):
                    w = Window().partitionBy(sf.lit('a')).orderBy(sf.lit('a'))
                    self.df = (
                        spark_df.withColumn('i
            copy iconCopy
            !pip install q keras==2.2.4
            !pip install q tensorflow==1.14.0
            
            cPickle.PicklingError: Could not serialize object: NotImplementedError
            Pythondot img6Lines of Code : 31dot img6License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            gradients = rdd.mapPartitions(worker.train).collect()
            
            # "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/resource_variable_ops.py"
            # line 1152
            def __reduce__(self):
                # The implementation mirrors tha
            Loading Spark 2.x DataFrame from MongoDB GridFS in Python
            Pythondot img7Lines of Code : 11dot img7License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            SPARK_CLASSPATH=./path/to/mongo-hadoop-core.jar pyspark
            
            sc = SparkContext(conf=sparkConf)
            
            mongo_conf = {
                "mongo.input.uri": "mongodb://..."
                "mongo.input.query": s"...mongo query here..."
            }
            
            rdd = sc.newAPI
            Elephas not loaded in PySpark: No module named elephas.spark_model
            Pythondot img8Lines of Code : 6dot img8License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            virtualenv venv --relocatable
            cd venv 
            zip -qr ../venv.zip *
            
            PYSPARK_PYTHON=./SP/bin/python spark-submit --master yarn --deploy-mode cluster --conf spark.yarn.appMasterEnv.PYSPARK_PYTHON=./SP/bin/python --driver-memory 4G --archives venv.

            Community Discussions

            QUESTION

            How to solve java error on Elephas basic sample?
            Asked 2020-May-05 at 10:34

            I use PySpark and Elephas but it's not working at the moment. I tried the example given on Elephas' doc Github. Please note, in the PySpark console, my code with Keras and Pandas works (but without using the PySpark library). But the example given on https://github.com/maxpumperla/elephas to interface Keras and the PySpark library with Elephas, doesn't work, and I don't know how to fix this problem at all. All my PySpark configuration is using Python 3.7

            Here is the content of my script and the error message:

            ...

            ANSWER

            Answered 2020-May-03 at 10:32

            After some research, I switched to java 8 and deleted my java 11 installation. Then, I manually rewrote all my installation under python2.7. Now I think it works. I also had to adapt the script a bit better to fit my x_train and y_train. I used the predict() function of keras to get an array that I think is consistent.

            Java 11 doesn't work with Spark 2.4, apparently it works fine with PySpark 3, check it out.

            Source https://stackoverflow.com/questions/61505864

            QUESTION

            No completed or running application displayed on Apache Spark
            Asked 2020-May-03 at 10:26

            When I launch my ANN script, everything works fine at console level, but nothing changes on the Spark web interface: The application is not displayed in Running Applications or Completed Applications. I created a config file spark-defaults.conf in which I put:

            ...

            ANSWER

            Answered 2020-May-03 at 10:26

            I found a solution: In fact spark takes into account first the script config, then the command config, then the general config. However, in my script, I had put

            Source https://stackoverflow.com/questions/61517596

            QUESTION

            PySpark Pipeline.fit(df) method give PicklingError: Could not serialize object: ValueError: substring not found while using Elephas
            Asked 2020-Apr-23 at 01:21

            I am working on the following dataset which is a Churn prediction problem: https://www.kaggle.com/jpacse/telecom-churn-new-cell2cell-dataset

            I am using pyspark, keras & Elephas to build a distributed neural network model using pyspark pipeline.

            When I fit the dataset in the pipeline I get the pickling error. I am following this link to build a model: https://github.com/aviolante/pyspark_dl_pipeline/blob/master/pyspark_dl_pipeline.ipynb

            The line on which I am getting the error in my code is:

            ...

            ANSWER

            Answered 2020-Apr-23 at 01:21

            The solution which worked for me is found here:

            https://github.com/maxpumperla/elephas/issues/151

            I downgraded my keras and tensorflow version using the following commands:

            Source https://stackoverflow.com/questions/61326144

            QUESTION

            SQL search multitable and contains
            Asked 2020-Feb-01 at 17:08

            Suppose that i have the following data:

            ...

            ANSWER

            Answered 2020-Feb-01 at 16:55

            Keep this as your base.

            Source https://stackoverflow.com/questions/60018592

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install elephas

            Just install elephas from PyPI with, Spark will be installed through pyspark for you. That's it, you should now be able to run Elephas examples.

            Support

            This great project was started by Max Pumperla, and is currently maintained by Daniel Cahall (https://github.com/danielenricocahall). If you have any questions, please feel free to open up an issue or send an email to danielenricocahall@gmail.com. If you want to contribute, feel free to submit a PR, or start a conversation about how we can go about implementing something.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/maxpumperla/elephas.git

          • CLI

            gh repo clone maxpumperla/elephas

          • sshUrl

            git@github.com:maxpumperla/elephas.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link