{"id":13398422,"url":"https://github.com/Lasagne/Lasagne","last_synced_at":"2025-03-14T02:31:20.412Z","repository":{"id":20642272,"uuid":"23924195","full_name":"Lasagne/Lasagne","owner":"Lasagne","description":"Lightweight library to build and train neural networks in Theano","archived":false,"fork":false,"pushed_at":"2022-03-26T02:58:32.000Z","size":2263,"stargazers_count":3850,"open_issues_count":139,"forks_count":940,"subscribers_count":215,"default_branch":"master","last_synced_at":"2025-02-19T09:24:54.719Z","etag":null,"topics":["deep-learning-library","neural-networks","python","theano"],"latest_commit_sha":null,"homepage":"http://lasagne.readthedocs.org/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Lasagne.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-11T15:31:41.000Z","updated_at":"2025-02-19T06:32:15.000Z","dependencies_parsed_at":"2022-08-21T19:00:54.279Z","dependency_job_id":null,"html_url":"https://github.com/Lasagne/Lasagne","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lasagne%2FLasagne","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lasagne%2FLasagne/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lasagne%2FLasagne/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lasagne%2FLasagne/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lasagne","download_url":"https://codeload.github.com/Lasagne/Lasagne/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243335382,"owners_count":20274898,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning-library","neural-networks","python","theano"],"created_at":"2024-07-30T19:00:25.474Z","updated_at":"2025-03-14T02:31:20.389Z","avatar_url":"https://github.com/Lasagne.png","language":"Python","funding_links":[],"categories":["Researchers","Python","Development","机器学习框架","Table of Contents","Codes","Uncategorized"],"sub_categories":["Frameworks","Python","General-Purpose Machine Learning","Uncategorized"],"readme":".. image:: https://readthedocs.org/projects/lasagne/badge/\n    :target: http://lasagne.readthedocs.org/en/latest/\n\n.. image:: https://travis-ci.org/Lasagne/Lasagne.svg\n    :target: https://travis-ci.org/Lasagne/Lasagne\n\n.. image:: https://img.shields.io/coveralls/Lasagne/Lasagne.svg\n    :target: https://coveralls.io/r/Lasagne/Lasagne\n\n.. image:: https://img.shields.io/badge/license-MIT-blue.svg\n    :target: https://github.com/Lasagne/Lasagne/blob/master/LICENSE\n\n.. image:: https://zenodo.org/badge/16974/Lasagne/Lasagne.svg\n   :target: https://zenodo.org/badge/latestdoi/16974/Lasagne/Lasagne\n\nLasagne\n=======\n\nLasagne is a lightweight library to build and train neural networks in Theano.\nIts main features are:\n\n* Supports feed-forward networks such as Convolutional Neural Networks (CNNs),\n  recurrent networks including Long Short-Term Memory (LSTM), and any\n  combination thereof\n* Allows architectures of multiple inputs and multiple outputs, including\n  auxiliary classifiers\n* Many optimization methods including Nesterov momentum, RMSprop and ADAM\n* Freely definable cost function and no need to derive gradients due to\n  Theano's symbolic differentiation\n* Transparent support of CPUs and GPUs due to Theano's expression compiler\n\nIts design is governed by `six principles\n\u003chttp://lasagne.readthedocs.org/en/latest/user/development.html#philosophy\u003e`_:\n\n* Simplicity: Be easy to use, easy to understand and easy to extend, to\n  facilitate use in research\n* Transparency: Do not hide Theano behind abstractions, directly process and\n  return Theano expressions or Python / numpy data types\n* Modularity: Allow all parts (layers, regularizers, optimizers, ...) to be\n  used independently of Lasagne\n* Pragmatism: Make common use cases easy, do not overrate uncommon cases\n* Restraint: Do not obstruct users with features they decide not to use\n* Focus: \"Do one thing and do it well\"\n\n\nInstallation\n------------\n\nIn short, you can install a known compatible version of Theano and the latest\nLasagne development version via:\n\n.. code-block:: bash\n\n  pip install -r https://raw.githubusercontent.com/Lasagne/Lasagne/master/requirements.txt\n  pip install https://github.com/Lasagne/Lasagne/archive/master.zip\n\nFor more details and alternatives, please see the `Installation instructions\n\u003chttp://lasagne.readthedocs.org/en/latest/user/installation.html\u003e`_.\n\n\nDocumentation\n-------------\n\nDocumentation is available online: http://lasagne.readthedocs.org/\n\nFor support, please refer to the `lasagne-users mailing list\n\u003chttps://groups.google.com/forum/#!forum/lasagne-users\u003e`_.\n\n\nExample\n-------\n\n.. code-block:: python\n\n  import lasagne\n  import theano\n  import theano.tensor as T\n\n  # create Theano variables for input and target minibatch\n  input_var = T.tensor4('X')\n  target_var = T.ivector('y')\n\n  # create a small convolutional neural network\n  from lasagne.nonlinearities import leaky_rectify, softmax\n  network = lasagne.layers.InputLayer((None, 3, 32, 32), input_var)\n  network = lasagne.layers.Conv2DLayer(network, 64, (3, 3),\n                                       nonlinearity=leaky_rectify)\n  network = lasagne.layers.Conv2DLayer(network, 32, (3, 3),\n                                       nonlinearity=leaky_rectify)\n  network = lasagne.layers.Pool2DLayer(network, (3, 3), stride=2, mode='max')\n  network = lasagne.layers.DenseLayer(lasagne.layers.dropout(network, 0.5),\n                                      128, nonlinearity=leaky_rectify,\n                                      W=lasagne.init.Orthogonal())\n  network = lasagne.layers.DenseLayer(lasagne.layers.dropout(network, 0.5),\n                                      10, nonlinearity=softmax)\n\n  # create loss function\n  prediction = lasagne.layers.get_output(network)\n  loss = lasagne.objectives.categorical_crossentropy(prediction, target_var)\n  loss = loss.mean() + 1e-4 * lasagne.regularization.regularize_network_params(\n          network, lasagne.regularization.l2)\n\n  # create parameter update expressions\n  params = lasagne.layers.get_all_params(network, trainable=True)\n  updates = lasagne.updates.nesterov_momentum(loss, params, learning_rate=0.01,\n                                              momentum=0.9)\n\n  # compile training function that updates parameters and returns training loss\n  train_fn = theano.function([input_var, target_var], loss, updates=updates)\n\n  # train network (assuming you've got some training data in numpy arrays)\n  for epoch in range(100):\n      loss = 0\n      for input_batch, target_batch in training_data:\n          loss += train_fn(input_batch, target_batch)\n      print(\"Epoch %d: Loss %g\" % (epoch + 1, loss / len(training_data)))\n\n  # use trained network for predictions\n  test_prediction = lasagne.layers.get_output(network, deterministic=True)\n  predict_fn = theano.function([input_var], T.argmax(test_prediction, axis=1))\n  print(\"Predicted class for first test input: %r\" % predict_fn(test_data[0]))\n\nFor a fully-functional example, see `examples/mnist.py \u003cexamples/mnist.py\u003e`_,\nand check the `Tutorial\n\u003chttp://lasagne.readthedocs.org/en/latest/user/tutorial.html\u003e`_ for in-depth\nexplanations of the same. More examples, code snippets and reproductions of\nrecent research papers are maintained in the separate `Lasagne Recipes\n\u003chttps://github.com/Lasagne/Recipes\u003e`_ repository.\n\n\nCitation\n--------\n\nIf you find Lasagne useful for your scientific work, please consider citing it\nin resulting publications. We provide a ready-to-use `BibTeX entry for citing\nLasagne \u003chttps://github.com/Lasagne/Lasagne/wiki/Lasagne-Citation-(BibTeX)\u003e`_.\n\n\nDevelopment\n-----------\n\nLasagne is a work in progress, input is welcome.\n\nPlease see the `Contribution instructions\n\u003chttp://lasagne.readthedocs.org/en/latest/user/development.html\u003e`_ for details\non how you can contribute!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLasagne%2FLasagne","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLasagne%2FLasagne","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLasagne%2FLasagne/lists"}