Questions tagged [norm]

NoRM is a MongoDB driver for .Net designed to provide access to strongly/statically-typed documents and collections.

norm
Filter by
Sorted by
Tagged with
83 votes
2 answers
20k views

Too much data duplication in mongodb?

I'm new to this whole NOSQL stuff and have recently been intrigued with mongoDB. I'm creating a new website from scratch and decided to go with MONGODB/NORM (for C#) as my only database. I've been ...
mike's user avatar
  • 831
29 votes
9 answers
31k views

MongoDB transactions in .NET in 2010?

Playing around with MongoDB and NoRM in .NET. Thing that confused me - there are no transactions (can't just tell MongoConnection.Begin/EndTransaction or something like that). I want to use Unit of ...
Arnis Lapsa's user avatar
  • 46.6k
28 votes
5 answers
75k views

Get the 1-norm of a vector in Python

How can I calculate the 1-norm of the difference of two vectors, ||a - b||_1 = sum(|a_i - b_i|) in Python? a = [1,2,3,4] b = [2,3,4,5] ||a - b||_1 = 4
user avatar
26 votes
7 answers
9k views

What is the most mature MongoDB driver for C#?

So, there are mongodb-csharp simple-mongodb NoRM as C# drivers for MongoDB available. Which one of them is the most mature and stable one? Why would you choose one over the other two? Are they ...
Markus Dulghier's user avatar
22 votes
3 answers
17k views

When to use Singleton vs Transient vs Request using Ninject and MongoDB

I'm not quite sure when I should use SingletonScope() vs TransientScope() vs RequestScope() when I do my binding in my global.cs file. I have for example my call to MongoSession (using NoRM and the ...
VinnyG's user avatar
  • 6,893
12 votes
2 answers
13k views

When should i be opening and closing MongoDB connections?

i am very new to MongoDB and NoSQL in general and i've just started building a site with MongoDB / Norm / ASP.NET MVC 3. I am wondering how i should be scoping the connections to my Mongo database. ...
Kimpo's user avatar
  • 5,836
10 votes
4 answers
24k views

How should I normalize a vector in Matlab where the sum is 1?

I need to normalize a vector of N integers so that: Each value is proportional to its original value (the value will be between 0 and 1) The sum of all values is =1 For instance: If I have a vector ...
dragonmnl's user avatar
  • 15k
9 votes
5 answers
5k views

How to pass ObjectId from MongoDB in MVC.net

I'm starting a new project with Mongo, NoRM and MVC .Net. Before I was using FluentNHibernate so my IDs were integer, now my IDs are ObjectId. So when I have an Edit link my URL looks like this : ...
VinnyG's user avatar
  • 6,893
8 votes
2 answers
5k views

linalg.norm not taking axis argument

I am using Python 3 within Pyzo. Please could you tell me why the linalg.norm function does not recognise the axis argument. This code: c = np.array([[ 1, 2, 3],[-1, 1, 4]]) d=linalg.norm(c, axis=1)...
Thomas Hopkins's user avatar
8 votes
4 answers
1k views

MongoDB, C# and NoRM + Denormalization

I am trying to use MongoDB, C# and NoRM to work on some sample projects, but at this point I'm having a much harder time wrapping my head around the data model. With RDBMS's related data is no problem....
jocull's user avatar
  • 20.5k
7 votes
4 answers
15k views

Norm of a arrays of vectors in python

I have this array A = array([[-0.49740509, -0.48618909, -0.49145315], [-0.48959259, -0.48618909, -0.49145315], [-0.49740509, -0.47837659, -0.49145315], ..., [ 0.03079315, -0.01194593, ...
Brian's user avatar
  • 14.5k
7 votes
2 answers
432 views

Interpreting the effect of LK Norm with different orders on training machine learning model with the presence of outliers

Both the RMSE and the MAE are ways to measure the distance between two vectors: the vector of predictions and the vector of target values. Various distance measures, or norms, are possible. Generally ...
I. A's user avatar
  • 2,312
6 votes
3 answers
5k views

Get norm of numpy sparse matrix rows

I have a sparse matrix that I obtained by using Sklearn's TfidfVectorizer object: vect = TfidfVectorizer(sublinear_tf=True, max_df=0.5, analyzer='word', vocabulary=my_vocab, stop_words='english') ...
Sterling's user avatar
  • 3,935
6 votes
5 answers
16k views

How to calculate Euclidean length of a matrix without loops?

It seems like the answer to this should be simple, but I am stumped. I have a matrix of Nx3 matrix where there 1st 2nd and 3rd columns are the X Y and Z coordinates of the nth item. I want to ...
Miebster's user avatar
  • 2,405
5 votes
2 answers
16k views

Normalizing rows of matrix, so that their norm is equal to 1 (MATLAB)

I have a following problem - I have a matrix A of size 16x22440. What I need to do is to normalize each row of this matrix, so that the norm of each of them is equal to 1 (for n=1:16 norm(A(n,:))==1) ...
Jacka's user avatar
  • 2,440
5 votes
2 answers
817 views

Compute distance in Cartesian Coordinate System in Mathematica

Analyzing Eye-movements on a screen, I set my origin to the bottom left corner of it (Hard to modify at that point). Trying to compute distance between some points and the center of the screen I use ...
500's user avatar
  • 6,569
5 votes
2 answers
534 views

Polymorphism problem in MongoDb with NoRM driver

I have classes [MongoDiscriminated] public abstract class Content { public int? Id { get; set; } public int? ParentId { get; set; } public string Slug { get; set; } public string Path ...
Mike Koder's user avatar
  • 1,898
4 votes
2 answers
6k views

Lazy loading in MongoDB with NoRM

I have a model similar to this: (simplified) Question: public class Question { public string QuestionID { get; set; } public string Title { get; set; } public string Body { get; set; } ...
Alex's user avatar
  • 37.9k
4 votes
3 answers
2k views

c# MongoDB (noRM) - Repository pattern with embedded documents

I’m developing an application with a model similar to Stack Overflow (question / answer etc...) Modelling a NoSQL Forum Application with C# / ASP.net MVC The model looks something like this (...
Alex's user avatar
  • 37.9k
4 votes
1 answer
2k views

Sort (symmetric) numpy 2D array by function. (norm)

How to sort a matrix by the norm of its rows efficiently(using numpy.ndarrays)? I want to sort the matrix A: A = np.array( ( [ 10, 1, 6, 3 ], [ 1,12, 2, 4 ], [ 6, 2,...
JLT's user avatar
  • 740
4 votes
1 answer
6k views

How to store nested objects in different mongodb collection?

I need to store some objects of this classes: public class Category{ public ObjectId Id {get;set;} public string Name {get;set;} public string Description {get;set;} public List<...
Michael's user avatar
  • 45
4 votes
1 answer
1k views

Mongo one to many relation and update problems

I'm implementing blog based on MongoDB. Let's look at first how Mongo guys recommend us to store blog post and its comments (http://www.mongodb.org/display/DOCS/Schema+Design): posts should be a ...
Alexey Zakharov's user avatar
4 votes
2 answers
1k views

MongoDB Norm query nested objects

Does anyone have a sample of how to query for nested/inner objects in MongoDB using NORM (C#)? For example, if a typical document in a collection looks like Order/OrderItems, how can I look up a ...
Howard's user avatar
  • 165
3 votes
1 answer
18k views

Calculating the norm of each row in a matrix [duplicate]

I have a Nx3 matrix (A) the columns are X,Y,Z respectively. I want to calculate the norm that is sqrt(X^2+Y^2+Z^2) for each row. I did a for loop for that: for i = 1:length(A) Result(i) = norm(A(i,:)...
Jack_111's user avatar
  • 881
3 votes
2 answers
1k views

Modelling a NoSQL Forum Application with C# / ASP.net MVC

I'm currently developing a Forum (Question / Answer) based application. Using C# ASP.net MVC and MongoDB for data storage. I'm currently looking at the model. I was thinking of having separate ...
Alex's user avatar
  • 37.9k
3 votes
1 answer
3k views

MongoDB - Hosting on multiple servers

I am wanting to use MongoDB on my Windows Server and I am using the .NET code at: https://github.com/atheken/NoRM/wiki/ I have 2 web servers that I need to host MongoDB on and keep the database on ...
Brandon's user avatar
  • 10.9k
3 votes
1 answer
748 views

Implementing a blog with MongoDB and NoRM: Relationships?

I'm starting to learn MongoDB, using the NoRM C# driver in an ASP.NET MVC project. I'm just writing POCO classes right now, and have question on how to implement relationships between Blog Posts, ...
Saxman's user avatar
  • 5,039
3 votes
1 answer
64 views

Discretized function becomes complex while free propagating a real function when sampled at even number of points using FFT and IFFT in Python

My code involves propagation of a real function using Fourier transform and inverse Fourier transform. Specifically, the function evolves as ∂ψ(z,t)/∂t - v ∂ψ(z,t)/∂z =0 I solve this problem by ...
Physics437's user avatar
3 votes
1 answer
184 views

Numerical problems with qnorm

I'm having a numeric issue using qnorm(psn()). The problem is numeric. Firstly, the Skew-Normal CDF round the result, since psn(9) is not 1: library(sn) psn(9) #[1] 1 then qnorm(psn(9)) #[1] Inf ...
DR15's user avatar
  • 693
3 votes
2 answers
697 views

Using the HiLoIdGenerator in NoRM for MongoDB to create a unique identifier

I have been struggling a little with the HiLoIdGenerator that comes with NoRM (http://normproject.org/); I want to use it to generate a unique identifier that I can use as a SLUG for my blog posts. At ...
nickbw's user avatar
  • 463
3 votes
1 answer
104 views

Problems with MATLAB nested statements and bisection

New to the site, but I'm trying to hone up on some MATLAB skills for work and school, and was looking for some help with the following: I want to write my own algorithm for finding the Hinf norm of a ...
Dustin Malcolm's user avatar
3 votes
1 answer
966 views

MongoDb NORM - Pagination and Total Documents

Using the MongoDb NORM driver, does anyone know whether it's possible to get the cursor to a 'queried' collection similar to below, so that a 'page' of documents can be retrieved as well as the total ...
John's user avatar
  • 57
3 votes
1 answer
3k views

Storing multiple types of objects in one collection in MongoDB using NoRM

MongoDB is schema-less. So, I can technically store any number of different types within one collection. We currently have the need to store multiple objects that inherit from the same base class in ...
dontangg's user avatar
  • 4,779
3 votes
1 answer
654 views

How to do an order by not case sensitive

I'm starting to work with MongoDB and NoRM and I would like to do an orderBy that is not Ccase sensitive, is it possible? Thanks for the help!
VinnyG's user avatar
  • 6,893
2 votes
1 answer
2k views

What is the difference between a Metric and a Norm?

From my understanding, a metric defines a more abstract entity than a norm, but I don't feel like I truly understand. Can someone please explain it to me in layman's terms?
Jaigus's user avatar
  • 1,442
2 votes
1 answer
2k views

tf.norm error ValueError: 'ord' must be a supported vector norm, got fro

I am trying to calculate the Frobenius Norm of my tensor W = tf.Variable(tf.random_normal([3072,20],stddev=0.1)) temp = tf.matmul(tf.transpose(W),W) fro_W = tf.norm(temp, ord ='fro') This produces ...
costisst's user avatar
  • 381
2 votes
2 answers
587 views

normrnd() and norm() operations without "for loop"

I have been searching around to write the following code without the "for loop". I have looked into array operations such as bsxfun(),arrayfun, or other MATLAB built-in functions but could not really ...
Omid's user avatar
  • 260
2 votes
3 answers
1k views

How can I use mongodb with linq for store large binary objects(files)?

I know two most popular C# drivers for mongodb, this are mongodb-csharp and NoRM. Both of them have some problems. For example, with mongodb-csharp I can't use full functional linq and with NoRM I can'...
Michael M.'s user avatar
  • 6,699
2 votes
1 answer
214 views

Matrix of norm differences from two coordinates matrices (numpy)

Let v, u be the 3D-coordinate matrices of shapes (n, 3) and (m, 3), respectively. I want to compute the matrix M of shape (n, m) such that M[i, j] = ||v[i] - u[j]|| -- the second vector norm. The task ...
Oleg Petrov's user avatar
2 votes
1 answer
6k views

Normalize.css does not fully add reset to react app

I'm following the instructions on Reacts official site here. I have an index.css file setup in the root of my src directory with the import as the say: @import-normalize; I then import the index.css ...
Carl Edwards's user avatar
  • 14.1k
2 votes
2 answers
624 views

Python Numpy Question and Python Version Question

I want to use Numpy with Python 3.2 and it won't work; it says I need 3.1. Does anyone know how to get around this issue, other than using 3.1? What do I have to import in order to make this work in a ...
TheChes44's user avatar
  • 646
2 votes
1 answer
211 views

How to make a change in a numeric solution to an ODE after it has been solved?

I have two Second Order ODE's of which I want to calculate the error between them using (with Maple) || B(t) - A(w*t) || = sqrt(int(B(t) - A(w*t) )^2), t = 0..T) Where A(t) is the solution to the ...
Gina Faraj Rabbah's user avatar
2 votes
1 answer
7k views

looking for a 3D version of numpy.linalg.norm

I'm looking for a build-in function in python. It should compute the frobenius norm of a 3D array. My current approach is: np.sqrt(np.sum(np.square(x[:,:,:]))) but this is too slow for the size ...
Bachbold's user avatar
  • 424
2 votes
2 answers
1k views

Mongodb NoRM and POCO

I am experimenting with Mongodb and NoRM in C#. From what I have read the ObjectId that uniquely identifies a document in Mongodb is a sort of "special" Guid (in the sense that is unique) but has ...
Ronnie's user avatar
  • 4,997
2 votes
1 answer
2k views

Any Differences in `cvxpy` Library Between L2 Norm and `sum_of_square()`?

I am trying to use cvxpy lib to solve a very simple least square problem. But I found that cvxpy gave me very different results when I use sum_squares and norm(x,2) as loss functions. The same ...
skinfaxi's user avatar
2 votes
1 answer
1k views

how to store files using MongoDb C# Norm

Can someone help me with a complete sample how to store a file using MongoDB, C# and Norm and manage the limitation size. I have read some ideas about but is not really clear for me. Thanks.
user325558's user avatar
  • 1,423
2 votes
2 answers
1k views

how to add new field in mongodb, if i use norm or csharp-mongodb drivers

I have two projects which are based on mongodb database. One project use csharp-mongodb and another - norm driver. I make request to my db only with generic methods like GetCollection. How can i add ...
Antony Blazer's user avatar
2 votes
0 answers
526 views

How to normalize matplotlib colormap on Natural Logarithm scale

I would like to use imshow for plotting a matrix whose elements are in [1, 64]. To normalise the colormap, I could only find "LogNorm", however, I need something like "LnNorm", normalising the matrix ...
Sahar's user avatar
  • 771
2 votes
1 answer
282 views

normalization of the same vector gives different values at two cases?

r_capr Out[148]: array([[-0.42300825, 0.90516059, 0.04181294]]) r_capr np.linalg.norm(r_capr.T) Out[149]: 0.99999999760432712 a.T Out[150]: array([[-0.42300825, 0.90516059, 0.04181294]]) a....
user22180's user avatar
  • 551
1 vote
2 answers
9k views

Norm function in OpenCV

How can I take easily norm of an array? I tried this and I have an error: too many initializers error C2440: 'initializing' : cannot convert from 'cv::OutputArray (__cdecl *)(void)' to 'double' ...
MerveMeriç's user avatar