function U = set(U,F,V)
  
  switch F
   case 'weights'
	if ndims(U.weights)~=ndims(V) || any(size(U.weights)~=size(V))
	  error('weights size does not match');
	end;
	
	U.weights = V;
	
   case 'bias'
	if ndims(U.bias)~=ndims(V) || any(size(U.bias)~=size(V))
	  error('bias size does not match');
	end;
	
	U.bias = V;

   case 'params'
	if length(V) ~= numel(U.weights)+numel(U.bias)
	  error('params size does not match');
	end;

	nW = numel(U.weights);

	U.weights(:) = V(1:nW);
	U.bias(:) = V(nW+1:end);
	
   otherwise
	
	U.factordiscr = set(U.factordiscr,F,V);
	
  end;
  
	  
	  
